Class: Boxxspring::Operation
- Inherits:
-
Object
- Object
- Boxxspring::Operation
- Defined in:
- lib/boxxspring/operation.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Operation
constructor
A new instance of Operation.
- #query ⇒ Object
Constructor Details
#initialize(path) ⇒ Operation
Returns a new instance of Operation.
5 6 7 8 |
# File 'lib/boxxspring/operation.rb', line 5 def initialize( path ) @path = path @parameters = {} end |
Instance Method Details
#query ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/boxxspring/operation.rb', line 10 def query result = nil Boxxspring::Request.new.tap do | request | request.get( @path ).tap do | response | parser = Boxxspring::Parser.new( response.content ) result = parser.resources end end result end |