Class: IOSTSdk::Http::GetChainInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/iost_sdk/http/get_chain_info.rb

Instance Method Summary collapse

Instance Method Details

#invoke(base_url:) ⇒ Object

Raises:



8
9
10
11
12
13
14
# File 'lib/iost_sdk/http/get_chain_info.rb', line 8

def invoke(base_url:)
  resp = HTTParty.get("#{base_url}/getChainInfo")
  raise HttpRequestError.new(status_code: resp.code, body: resp.body) unless
    resp.code == 200

  IOSTSdk::Models::ChainInfo.new.populate(model_data: JSON.parse(resp.body))
end