Class: Webtractor::Result
- Inherits:
-
Object
- Object
- Webtractor::Result
- Defined in:
- lib/webtractor/result.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#title ⇒ Object
Returns the value of attribute title.
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(title, xml) ⇒ Result
constructor
A new instance of Result.
- #save(filename) ⇒ Object
Constructor Details
#initialize(title, xml) ⇒ Result
5 6 7 8 9 |
# File 'lib/webtractor/result.rb', line 5 def initialize title, xml @title = title @text = xml.text @xml = xml end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/webtractor/result.rb', line 3 def text @text end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/webtractor/result.rb', line 3 def title @title end |
#xml ⇒ Object
Returns the value of attribute xml.
3 4 5 |
# File 'lib/webtractor/result.rb', line 3 def xml @xml end |
Instance Method Details
#save(filename) ⇒ Object
11 12 13 |
# File 'lib/webtractor/result.rb', line 11 def save filename File.write(filename, @xml.to_s) end |