Class: EverSdk::Abi::AbiEvent
- Inherits:
-
Object
- Object
- EverSdk::Abi::AbiEvent
- Defined in:
- lib/ever_sdk_client/abi.rb
Instance Attribute Summary collapse
-
#id_ ⇒ Object
readonly
Returns the value of attribute id_.
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, inputs:, id_:) ⇒ AbiEvent
constructor
A new instance of AbiEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, inputs:, id_:) ⇒ AbiEvent
Returns a new instance of AbiEvent.
498 499 500 501 502 |
# File 'lib/ever_sdk_client/abi.rb', line 498 def initialize(name:, inputs:, id_:) @name = name @inputs = inputs @id_ = id_ end |
Instance Attribute Details
#id_ ⇒ Object (readonly)
Returns the value of attribute id_.
496 497 498 |
# File 'lib/ever_sdk_client/abi.rb', line 496 def id_ @id_ end |
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
496 497 498 |
# File 'lib/ever_sdk_client/abi.rb', line 496 def inputs @inputs end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
496 497 498 |
# File 'lib/ever_sdk_client/abi.rb', line 496 def name @name end |
Class Method Details
.from_json(j) ⇒ Object
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/ever_sdk_client/abi.rb', line 518 def self.from_json(j) return nil if j.nil? inp_s = if j["inputs"].nil? [] else j["inputs"].compact.map do |x| # TODO recursive parsing of AbiParam AbiParam.from_json(x) end end self.new( name: j["name"], inputs: inp_s, id_: j["id"], ) end |
Instance Method Details
#to_h ⇒ Object
504 505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/ever_sdk_client/abi.rb', line 504 def to_h in_h_s = if !@inputs.nil? @inputs.compact.map(&:to_h) else [] end { name: @name, inputs: in_h_s, id: @id_ } end |