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.



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

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.



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

def x
  @x
end

#yObject Also known as: g

Returns the value of attribute y.



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

def y
  @y
end

#zObject 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

#inspectObject



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

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

#setallObject



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

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

#to_aObject



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

def to_a
  [x,y,z]
end

#to_sObject



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

def to_s
  to_a.join(' ')
end