Class: SyncwiseApi::Responses::V1_0::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/syncwise_api/responses/V1_0/base.rb

Direct Known Subclasses

Standard

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response_object) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
11
# File 'lib/syncwise_api/responses/V1_0/base.rb', line 6

def initialize(http_response_object)
  @http_response_object = http_response_object
  @body = @http_response_object.body
  @header_hash = @http_response_object.header.to_hash.symbolize_keys
  @body_hash = parse
end

Instance Attribute Details

#body_hashObject (readonly)

Returns the value of attribute body_hash.



13
14
15
# File 'lib/syncwise_api/responses/V1_0/base.rb', line 13

def body_hash
  @body_hash
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/syncwise_api/responses/V1_0/base.rb', line 15

def valid?
  @body_hash[:sts] == '1'
end