Class: Psei::Parser
- Inherits:
-
Object
- Object
- Psei::Parser
- Defined in:
- lib/psei/parser.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, headers) ⇒ Parser
constructor
A new instance of Parser.
- #process(response = nil) ⇒ Object
Constructor Details
#initialize(url, headers) ⇒ Parser
Returns a new instance of Parser.
7 8 9 10 |
# File 'lib/psei/parser.rb', line 7 def initialize url, headers @url = url @headers = headers end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/psei/parser.rb', line 5 def url @url end |
Instance Method Details
#process(response = nil) ⇒ Object
12 13 14 15 |
# File 'lib/psei/parser.rb', line 12 def process(response=nil) resp = response || get_response JSON.parse(resp) end |