Class: TEF::Animation::Coordinate

Inherits:
Object
  • Object
show all
Defined in:
lib/tef/Animation/Coordinate.rb

Instance Method Summary collapse

Constructor Details

#initialize(start_offset) ⇒ Coordinate

Returns a new instance of Coordinate.



34
35
36
37
38
39
40
# File 'lib/tef/Animation/Coordinate.rb', line 34

def initialize(start_offset)
	@animatable_attributes = {}

	$coordinate_def.each do |key, v|
		@animatable_attributes[key] = Value.new(v + start_offset)
	end
end

Instance Method Details

#animatable_attributesObject



42
43
44
# File 'lib/tef/Animation/Coordinate.rb', line 42

def animatable_attributes
	@animatable_attributes.values
end

#configure(data) ⇒ Object

Raises:

  • (ArgumentError)


46
47
48
49
50
51
52
53
54
55
56
# File 'lib/tef/Animation/Coordinate.rb', line 46

def configure(data)
	raise ArgumentError, 'Coordinate config must be a hash!' unless data.is_a? Hash

	data.each do |key, value|
		coord = @animatable_attributes[key]

		raise ArgumentError, "Coordinate #{key} does not exist!" unless coord

		coord.configure value
	end
end