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.



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

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.



150
151
152
# File 'lib/ruic/attributes.rb', line 150

def x
  @x
end

#yObject Also known as: g

Returns the value of attribute y.



150
151
152
# File 'lib/ruic/attributes.rb', line 150

def y
  @y
end

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

#inspectObject



169
170
171
# File 'lib/ruic/attributes.rb', line 169

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

#setallObject



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

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

#to_aObject



175
176
177
# File 'lib/ruic/attributes.rb', line 175

def to_a
	[x,y,z]
end

#to_sObject



172
173
174
# File 'lib/ruic/attributes.rb', line 172

def to_s
	to_a.join(' ')
end