class BlockstreamSatellite::Response

Attributes

body[RW]
error[RW]
response[RW]

Public Class Methods

new(response) click to toggle source
# File lib/blockstream_satellite/response.rb, line 6
def initialize(response)
  if response.is_a?(Faraday::ClientError)
    @error = response
  else
    @response = response
    @body = response.body
  end
end

Public Instance Methods

[](key) click to toggle source
# File lib/blockstream_satellite/response.rb, line 19
def [](key)
  self.body[key.to_s]
end
success?() click to toggle source
# File lib/blockstream_satellite/response.rb, line 15
def success?
  self.error.nil? && !self.response.nil? && self.response.success?
end