Class: RubyBHL::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyBHL/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
12
13
14
15
16
# File 'lib/rubyBHL/response.rb', line 7

def initialize(options = {}) 
  opts = {
    request: nil 
  }.merge!(options)

  raise if opts[:request].nil? || opts[:request].class != RubyBHL::Request

  @json = {}
  @json = JSON.parse(Net::HTTP.get_response(URI.parse(opts[:request].search_url)).body)
end

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



5
6
7
# File 'lib/rubyBHL/response.rb', line 5

def json
  @json
end