Class: Factual::CoreResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/factual/core_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ CoreResponse

Returns a new instance of CoreResponse.



6
7
8
# File 'lib/factual/core_response.rb', line 6

def initialize(response)
    @body = rash_response(response)
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



4
5
6
# File 'lib/factual/core_response.rb', line 4

def body
  @body
end

Instance Method Details

#error_messageObject



22
23
24
# File 'lib/factual/core_response.rb', line 22

def error_message
  # @body.message.text unless success?
end

#schemaObject



26
27
28
29
30
# File 'lib/factual/core_response.rb', line 26

def schema
    if !@body.response.view.blank?
        @body.response.view
    end
end

#statusObject



14
15
16
# File 'lib/factual/core_response.rb', line 14

def status
    @body.status
end

#success?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/factual/core_response.rb', line 18

def success?
    @body.status == "ok"
end

#versionObject



10
11
12
# File 'lib/factual/core_response.rb', line 10

def version
    @body.version
end