home *** CD-ROM | disk | FTP | other *** search
/ Freelog 100 / FreelogNo100-NovembreDecembre2010.iso / Graphisme / GoogleSketchUp / GoogleSketchUpWFR.exe / GoogleSketchUp8.msi / SketchUpMeta.cab / extensions.rb.78D17A5F_0E0A_44D2_877D_2C56D45D16B7 < prev    next >
Encoding:
Text File  |  2010-08-26  |  1.3 KB  |  39 lines

  1. # Copyright 2005-2008, Google, Inc.
  2.  
  3. # This software is provided as an example of using the Ruby interface
  4. # to SketchUp.
  5.  
  6. # Permission to use, copy, modify, and distribute this software for 
  7. # any purpose and without fee is hereby granted, provided that the above
  8. # copyright notice appear in all copies.
  9.  
  10. # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  11. # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  12. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  13. #-----------------------------------------------------------------------------
  14.  
  15. #=============================================================================
  16. # Base class for extensions.  I could have defined separate classes for each
  17. # extension, but for testing this made it a little easier.
  18.  
  19. class SketchupExtension
  20.  
  21.     attr_accessor :name, :description, :version, :creator, :copyright
  22.  
  23.     # REVIEW: Passing the description in as an argument to new makes it hard to use
  24.     # very descriptive descriptions.
  25.     def initialize(name, filePath)
  26.         @name = name
  27.         @description = description
  28.         @path = filePath
  29.         
  30.         @version = "1.0"
  31.         @creator = "Google"
  32.         @copyright = "2010, Google"
  33.     end
  34.  
  35.     def load
  36.         Sketchup::require @path
  37.     end
  38.  
  39. end