Class: Collada::Parser::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/collada/parser/support.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, target) ⇒ Channel

Returns a new instance of Channel.



401
402
403
404
# File 'lib/collada/parser/support.rb', line 401

def initialize(source, target)
	@source = source
	@target = target
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



406
407
408
# File 'lib/collada/parser/support.rb', line 406

def source
  @source
end

#targetObject (readonly)

Returns the value of attribute target.



407
408
409
# File 'lib/collada/parser/support.rb', line 407

def target
  @target
end

Class Method Details

.parse(doc, element, sources = {}) ⇒ Object

Raises:

  • (ArgumentError)


409
410
411
412
413
414
415
416
417
418
# File 'lib/collada/parser/support.rb', line 409

def self.parse(doc, element, sources = {})
	source_id = element.attributes['source'].sub(/^#/, '')
	target_id = element.attributes['target']
	
	source = sources[source_id]
	
	raise ArgumentError.new("Could not find #{source_id} in #{sources.keys.inspect}!") unless source
	
	self.new(source, target_id)
end