Class: CardanoExplorer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cardano_explorer/base.rb

Direct Known Subclasses

Address, Block, Genesis, Transaction

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = nil) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/cardano_explorer/base.rb', line 9

def initialize(hash = nil)
  @hash = hash
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



3
4
5
# File 'lib/cardano_explorer/base.rb', line 3

def hash
  @hash
end

Class Method Details

.find(hash) ⇒ Object



5
6
7
# File 'lib/cardano_explorer/base.rb', line 5

def self.find(hash)
  new hash
end

Instance Method Details

#summaryObject



13
14
15
16
# File 'lib/cardano_explorer/base.rb', line 13

def summary
  @summary ||= self.class.get "summary/#{hash}"
  @summary.parsed_response['Right']
end