Class: MotionTube::Parser
- Inherits:
-
Object
- Object
- MotionTube::Parser
- Defined in:
- lib/motion-tube/parser.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#response ⇒ Object
Returns the value of attribute response.
-
#rest_client ⇒ Object
Returns the value of attribute rest_client.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Parser
constructor
A new instance of Parser.
- #parse(options, &block) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Parser
Returns a new instance of Parser.
4 5 6 7 |
# File 'lib/motion-tube/parser.rb', line 4 def initialize( = {}) self. = set_rest_client "http://www.youtube.com" end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/motion-tube/parser.rb', line 3 def @options end |
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'lib/motion-tube/parser.rb', line 3 def response @response end |
#rest_client ⇒ Object
Returns the value of attribute rest_client.
3 4 5 |
# File 'lib/motion-tube/parser.rb', line 3 def rest_client @rest_client end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/motion-tube/parser.rb', line 3 def url @url end |
Instance Method Details
#parse(options, &block) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/motion-tube/parser.rb', line 9 def parse(, &block) self..merge! if block get_response(&block) else raise "need a block to parse result" end end |