Class: PoxyClient::Processor
- Inherits:
-
Object
- Object
- PoxyClient::Processor
- Defined in:
- lib/poxy_client/processor.rb
Instance Method Summary collapse
- #complete_items ⇒ Object
-
#initialize(options = {}) ⇒ Processor
constructor
A new instance of Processor.
-
#parse(content) ⇒ Array
Parse the JSON encoded string from the retriever and generates an Object.
- #raw_items ⇒ Object
- #response ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Processor
Returns a new instance of Processor.
4 5 6 |
# File 'lib/poxy_client/processor.rb', line 4 def initialize( = {}) end |
Instance Method Details
#complete_items ⇒ Object
27 28 29 |
# File 'lib/poxy_client/processor.rb', line 27 def complete_items @complete_items end |
#parse(content) ⇒ Array
Parse the JSON encoded string from the retriever and generates an Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/poxy_client/processor.rb', line 12 def parse(content) @response = [] if ( content.respond_to?(:body) ) @response = JSON.parse(content.body) else @response = JSON.parse(content) end @complete_items = @response["items"] @raw_items = @response["items"].map{|i| i['raw']} end |
#raw_items ⇒ Object
31 32 33 |
# File 'lib/poxy_client/processor.rb', line 31 def raw_items @raw_items end |
#response ⇒ Object
23 24 25 |
# File 'lib/poxy_client/processor.rb', line 23 def response @response end |