Class: Collada::Parser::Channel
- Inherits:
-
Object
- Object
- Collada::Parser::Channel
- Defined in:
- lib/collada/parser/support.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source, target) ⇒ Channel
constructor
A new instance of Channel.
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
#source ⇒ Object (readonly)
Returns the value of attribute source.
406 407 408 |
# File 'lib/collada/parser/support.rb', line 406 def source @source end |
#target ⇒ Object (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
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 |