Class: VORuby::VOEvent::V1_1::Described
- Inherits:
-
Base
- Object
- Base
- VORuby::VOEvent::V1_1::Described
show all
- Defined in:
- lib/voruby/voevent/1.1/voevent.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#element
Constructor Details
#initialize(descriptions = nil, references = nil) ⇒ Described
Returns a new instance of Described.
162
163
164
165
|
# File 'lib/voruby/voevent/1.1/voevent.rb', line 162
def initialize(descriptions=nil, references=nil)
self.descriptions = descriptions
self.references = references
end
|
Instance Attribute Details
#descriptions ⇒ Object
Returns the value of attribute descriptions.
160
161
162
|
# File 'lib/voruby/voevent/1.1/voevent.rb', line 160
def descriptions
@descriptions
end
|
#references ⇒ Object
Returns the value of attribute references.
160
161
162
|
# File 'lib/voruby/voevent/1.1/voevent.rb', line 160
def references
@references
end
|
Class Method Details
.described_from_xml(root) ⇒ Object
.from_xml(xml) ⇒ Object
213
214
215
216
|
# File 'lib/voruby/voevent/1.1/voevent.rb', line 213
def self.from_xml(xml)
root = element_from(xml)
self.new(*described_from_xml(root))
end
|
Instance Method Details
#==(h) ⇒ Object
185
186
187
188
|
# File 'lib/voruby/voevent/1.1/voevent.rb', line 185
def ==(h)
self.descriptions == h.descriptions and
self.references == h.references
end
|
#to_xml(name = nil) ⇒ Object
190
191
192
193
194
195
196
197
198
|
# File 'lib/voruby/voevent/1.1/voevent.rb', line 190
def to_xml(name=nil)
el = element(name)
self.descriptions.each{ |d| el.add_element(d.to_xml('Description')) } if self.descriptions
self.references.each{ |r| el.add_element(r.to_xml('Reference')) } if self.references
collapse_namespaces(el)
el
end
|