Class: Collada::Parser::Reference
- Inherits:
-
Object
- Object
- Collada::Parser::Reference
- Defined in:
- lib/collada/parser/support.rb
Direct Known Subclasses
VisualScene::ControllerInstance, VisualScene::GeometryInstance, VisualScene::NodeReference
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(kind, url) ⇒ Reference
constructor
A new instance of Reference.
- #lookup(library) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(kind, url) ⇒ Reference
Returns a new instance of Reference.
82 83 84 85 |
# File 'lib/collada/parser/support.rb', line 82 def initialize(kind, url) @kind = kind @url = url end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
87 88 89 |
# File 'lib/collada/parser/support.rb', line 87 def kind @kind end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
88 89 90 |
# File 'lib/collada/parser/support.rb', line 88 def url @url end |
Instance Method Details
#id ⇒ Object
90 91 92 |
# File 'lib/collada/parser/support.rb', line 90 def id url.sub(/^.*\#/, '') end |
#lookup(library) ⇒ Object
94 95 96 97 98 99 100 |
# File 'lib/collada/parser/support.rb', line 94 def lookup(library) library[@kind].each do |item| return item if item.id == id end return nil end |
#to_s ⇒ Object
102 103 104 |
# File 'lib/collada/parser/support.rb', line 102 def to_s "\#<#{self.class} #{@url.dump} in #{@kind}>" end |