Class: UIC::Property::VectorValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asset, property, slide, str) ⇒ VectorValue

Returns a new instance of VectorValue.



136
137
138
139
140
141
# File 'lib/ruic/attributes.rb', line 136

def initialize(asset,property,slide,str)
  @asset    = asset
  @property = property
  @slide    = slide
  @x, @y, @z = str.split(/\s+/).map(&:to_f)
end

Instance Attribute Details

#xObject Also known as: r

Returns the value of attribute x.



135
136
137
# File 'lib/ruic/attributes.rb', line 135

def x
  @x
end

#yObject Also known as: g

Returns the value of attribute y.



135
136
137
# File 'lib/ruic/attributes.rb', line 135

def y
  @y
end

#zObject Also known as: b

Returns the value of attribute z.



135
136
137
# File 'lib/ruic/attributes.rb', line 135

def z
  @z
end

Instance Method Details

#inspectObject



154
155
156
# File 'lib/ruic/attributes.rb', line 154

def inspect
  "<#{@asset.path}.#{@property.name}: #{self}>"
end

#setallObject



142
143
144
# File 'lib/ruic/attributes.rb', line 142

def setall
  @property.set( @asset, to_s, @slide )
end

#to_aObject



160
161
162
# File 'lib/ruic/attributes.rb', line 160

def to_a
  [x,y,z]
end

#to_sObject



157
158
159
# File 'lib/ruic/attributes.rb', line 157

def to_s
  to_a.join(' ')
end