Class: FOaaS::FO
- Inherits:
-
PayDirt::Base
- Object
- PayDirt::Base
- FOaaS::FO
- Defined in:
- lib/foaas/f_o.rb
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(options = {}) ⇒ FO
constructor
A new instance of FO.
Constructor Details
#initialize(options = {}) ⇒ FO
Returns a new instance of FO.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/foaas/f_o.rb', line 3 def initialize( = {}) = { resource: 'off', name: nil, from: 'me', root_url: 'http://foaas.herokuapp.com', http_headers: { "Accept" => "application/json", } }.merge() .merge!({ uri: [ [:root_url], [:resource], [:name], [:from] ].compact.join("/") }) [:root_url, :resource, :name, :from].map do |o| .delete o end (:uri, :http_headers, ) end |
Instance Method Details
#execute! ⇒ Object
30 31 32 |
# File 'lib/foaas/f_o.rb', line 30 def execute! return result(true, JSON.parse(open(@uri, @http_headers).read)) end |