Class: Linkser::Parser
- Inherits:
-
Object
- Object
- Linkser::Parser
- Defined in:
- lib/linkser/parser.rb
Instance Attribute Summary collapse
-
#last_url ⇒ Object
readonly
Returns the value of attribute last_url.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(url, options = {}) ⇒ Parser
Returns a new instance of Parser.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/linkser/parser.rb', line 8 def initialize url, ={} head = get_head url, @object = case head.content_type when "text/html" Linkser::Objects::HTML.new url, last_url, head, else Linkser::Object.new url, last_url, head, end end |
Instance Attribute Details
#last_url ⇒ Object (readonly)
Returns the value of attribute last_url.
6 7 8 |
# File 'lib/linkser/parser.rb', line 6 def last_url @last_url end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
6 7 8 |
# File 'lib/linkser/parser.rb', line 6 def object @object end |