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.
151 152 153 154 155 156 |
# File 'lib/ruic/attributes.rb', line 151 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.
150 151 152 |
# File 'lib/ruic/attributes.rb', line 150 def x @x end |
#y ⇒ Object Also known as: g
Returns the value of attribute y.
150 151 152 |
# File 'lib/ruic/attributes.rb', line 150 def y @y end |
#z ⇒ Object Also known as: b
Returns the value of attribute z.
150 151 152 |
# File 'lib/ruic/attributes.rb', line 150 def z @z end |
Instance Method Details
#inspect ⇒ Object
169 170 171 |
# File 'lib/ruic/attributes.rb', line 169 def inspect "<#{@asset.path}.#{@property.name}: #{self}>" end |
#setall ⇒ Object
157 158 159 |
# File 'lib/ruic/attributes.rb', line 157 def setall @property.set( @asset, to_s, @slide ) end |
#to_a ⇒ Object
175 176 177 |
# File 'lib/ruic/attributes.rb', line 175 def to_a [x,y,z] end |
#to_s ⇒ Object
172 173 174 |
# File 'lib/ruic/attributes.rb', line 172 def to_s to_a.join(' ') end |