Class: GoobyXmlObject
- Inherits:
-
GoobyBaseObject
- Object
- GoobyBaseObject
- GoobyXmlObject
- Defined in:
- lib/gooby_xml_object.rb
Overview
Gooby = Google APIs + Ruby. Copyright 2009 by Chris Joakim. Gooby is available under GNU General Public License (GPL) license.
Direct Known Subclasses
Constant Summary
Constants inherited from GoobyBaseObject
GoobyBaseObject::KILOMETERS_PER_MILE, GoobyBaseObject::METERS_PER_FOOT, GoobyBaseObject::MILES_PER_KILOMETER, GoobyBaseObject::SECONDS_PER_HOUR, GoobyBaseObject::UOM_KILOMETERS, GoobyBaseObject::UOM_MILES, GoobyBaseObject::UOM_YARDS, GoobyBaseObject::YARDS_PER_KILOMETER, GoobyBaseObject::YARDS_PER_MILE
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
Instance Method Summary collapse
- #add(object) ⇒ Object
- #base_initialize ⇒ Object
- #get(name) ⇒ Object
- #id ⇒ Object
-
#initialize ⇒ GoobyXmlObject
constructor
A new instance of GoobyXmlObject.
- #sequence ⇒ Object
- #set(name, value) ⇒ Object
Methods inherited from GoobyBaseObject
boolean_config_value, config_value, get_config, set_config
Methods included from GoobyIO
#read_file_as_lines, #write_file, #write_lines
Methods included from GoobyIntrospection
Methods included from GoobyEnvironment
#array_param, #boolean_param, #command_line_arg, #float_param, #integer_param, #string_param
Constructor Details
#initialize ⇒ GoobyXmlObject
Returns a new instance of GoobyXmlObject.
12 13 14 |
# File 'lib/gooby_xml_object.rb', line 12 def initialize base_initialize end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
10 11 12 |
# File 'lib/gooby_xml_object.rb', line 10 def hash @hash end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
10 11 12 |
# File 'lib/gooby_xml_object.rb', line 10 def list @list end |
Instance Method Details
#add(object) ⇒ Object
28 29 30 |
# File 'lib/gooby_xml_object.rb', line 28 def add(object) @list << object end |
#base_initialize ⇒ Object
16 17 18 |
# File 'lib/gooby_xml_object.rb', line 16 def base_initialize @hash, @list = Hash.new(''), [] end |
#get(name) ⇒ Object
24 25 26 |
# File 'lib/gooby_xml_object.rb', line 24 def get(name) @hash[name] end |
#id ⇒ Object
32 33 34 |
# File 'lib/gooby_xml_object.rb', line 32 def id get('Id') end |
#sequence ⇒ Object
36 37 38 |
# File 'lib/gooby_xml_object.rb', line 36 def sequence get('Seq') end |
#set(name, value) ⇒ Object
20 21 22 |
# File 'lib/gooby_xml_object.rb', line 20 def set(name, value) @hash[name] = value.to_s.strip if name && value end |