Class: DatagroutConduit::ToolMeta

Inherits:
Struct
  • Object
show all
Defined in:
lib/datagrout_conduit/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#credit_estimateObject

Returns the value of attribute credit_estimate

Returns:

  • (Object)

    the current value of credit_estimate



81
82
83
# File 'lib/datagrout_conduit/types.rb', line 81

def credit_estimate
  @credit_estimate
end

#receiptObject

Returns the value of attribute receipt

Returns:

  • (Object)

    the current value of receipt



81
82
83
# File 'lib/datagrout_conduit/types.rb', line 81

def receipt
  @receipt
end

Class Method Details

.from_hash(hash) ⇒ Object



82
83
84
85
86
87
88
89
90
# File 'lib/datagrout_conduit/types.rb', line 82

def self.from_hash(hash)
  return nil if hash.nil?

  hash = hash.transform_keys(&:to_s)
  new(
    receipt: Receipt.from_hash(hash["receipt"]),
    credit_estimate: CreditEstimate.from_hash(hash["credit_estimate"])
  )
end