Class: Gippix::Base
- Inherits:
-
Object
- Object
- Gippix::Base
- Defined in:
- lib/gippix.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(file_name) ⇒ Base
constructor
A new instance of Base.
- #with(xpath) {|@doc.xpath(xpath)| ... } ⇒ Object
Constructor Details
#initialize(file_name) ⇒ Base
Returns a new instance of Base.
37 38 39 40 41 |
# File 'lib/gippix.rb', line 37 def initialize(file_name) @file_name = file_name @doc = Nokogiri::XML( File.read file_name ) @points = [] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
35 36 37 |
# File 'lib/gippix.rb', line 35 def description @description end |
#doc ⇒ Object
Returns the value of attribute doc.
35 36 37 |
# File 'lib/gippix.rb', line 35 def doc @doc end |
#file_name ⇒ Object
Returns the value of attribute file_name.
35 36 37 |
# File 'lib/gippix.rb', line 35 def file_name @file_name end |
#name ⇒ Object
Returns the value of attribute name.
35 36 37 |
# File 'lib/gippix.rb', line 35 def name @name end |
#points ⇒ Object
Returns the value of attribute points.
35 36 37 |
# File 'lib/gippix.rb', line 35 def points @points end |
Instance Method Details
#with(xpath) {|@doc.xpath(xpath)| ... } ⇒ Object
43 44 45 |
# File 'lib/gippix.rb', line 43 def with xpath, &blk yield @doc.xpath(xpath) end |