Class: UIC::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/ruic/attributes.rb

Direct Known Subclasses

Boolean, Float, Image, Long, ObjectRef, String, Vector

Defined Under Namespace

Classes: Boolean, Float, Image, Long, ObjectRef, ObjectReference, String, Texture, Vector, VectorValue

Constant Summary collapse

MultiLineString =
String
Rotation =
Vector
Color =
Vector
Float2 =
Vector
Import =

TODO: a real class

String
Mesh =

TODO: a real class

String
Renderable =

TODO: a real class

String
Font =

TODO: a real class

String
FontSize =
Long
StringListOrInt =

TODO: a real class

String

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(el) ⇒ Property

Returns a new instance of Property.



4
# File 'lib/ruic/attributes.rb', line 4

def initialize(el); @el = el; end

Class Attribute Details

.defaultObject

Returns the value of attribute default.



3
4
5
# File 'lib/ruic/attributes.rb', line 3

def default
  @default
end

Instance Method Details

#defaultObject



11
# File 'lib/ruic/attributes.rb', line 11

def default; @def ||= (@el['default'] || self.class.default); end

#descriptionObject



10
# File 'lib/ruic/attributes.rb', line 10

def description; @desc||=@el['description']; end

#formalObject



7
# File 'lib/ruic/attributes.rb', line 7

def formal; @formal||=@el['formalName'] || @el['name']; end

#get(asset, slide) ⇒ Object



12
13
14
15
16
# File 'lib/ruic/attributes.rb', line 12

def get(asset,slide)
  if asset.slide? || asset.has_slide?(slide)
    asset.presentation.get_attribute(asset,name,slide) || default
  end
end

#inspectObject



20
21
22
# File 'lib/ruic/attributes.rb', line 20

def inspect
  "<#{type} '#{name}'>"
end

#maxObject



9
# File 'lib/ruic/attributes.rb', line 9

def max; @el['max']; end

#minObject



8
# File 'lib/ruic/attributes.rb', line 8

def min; @el['min']; end

#nameObject



5
# File 'lib/ruic/attributes.rb', line 5

def name; @name||=@el['name']; end

#set(asset, new_value, slide_name_or_index) ⇒ Object



17
18
19
# File 'lib/ruic/attributes.rb', line 17

def set(asset,new_value,slide_name_or_index)
  asset.presentation.set_attribute(asset,name,slide_name_or_index,new_value)
end

#typeObject



6
# File 'lib/ruic/attributes.rb', line 6

def type; @type||=@el['type']; end