Class: UIC::Property::VectorValue
- Inherits:
-
Object
- Object
- UIC::Property::VectorValue
- Defined in:
- lib/ruic/attributes.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
(also: #r)
Returns the value of attribute x.
-
#y ⇒ Object
(also: #g)
Returns the value of attribute y.
-
#z ⇒ Object
(also: #b)
Returns the value of attribute z.
Instance Method Summary collapse
-
#initialize(asset, property, slide, str) ⇒ VectorValue
constructor
A new instance of VectorValue.
- #inspect ⇒ Object
- #setall ⇒ Object
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(asset, property, slide, str) ⇒ VectorValue
Returns a new instance of VectorValue.
137 138 139 140 141 142 |
# File 'lib/ruic/attributes.rb', line 137 def initialize(asset,property,,str) @asset = asset @property = property @slide = @x, @y, @z = str.split(/\s+/).map(&:to_f) end |
Instance Attribute Details
#x ⇒ Object Also known as: r
Returns the value of attribute x.
136 137 138 |
# File 'lib/ruic/attributes.rb', line 136 def x @x end |
#y ⇒ Object Also known as: g
Returns the value of attribute y.
136 137 138 |
# File 'lib/ruic/attributes.rb', line 136 def y @y end |
#z ⇒ Object Also known as: b
Returns the value of attribute z.
136 137 138 |
# File 'lib/ruic/attributes.rb', line 136 def z @z end |
Instance Method Details
#inspect ⇒ Object
155 156 157 |
# File 'lib/ruic/attributes.rb', line 155 def inspect "<#{@asset.path}.#{@property.name}: #{self}>" end |
#setall ⇒ Object
143 144 145 |
# File 'lib/ruic/attributes.rb', line 143 def setall @property.set( @asset, to_s, @slide ) end |
#to_a ⇒ Object
161 162 163 |
# File 'lib/ruic/attributes.rb', line 161 def to_a [x,y,z] end |
#to_s ⇒ Object
158 159 160 |
# File 'lib/ruic/attributes.rb', line 158 def to_s to_a.join(' ') end |