Class: DatagroutConduit::CreditEstimate

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#actual_totalObject

Returns the value of attribute actual_total

Returns:

  • (Object)

    the current value of actual_total



64
65
66
# File 'lib/datagrout_conduit/types.rb', line 64

def actual_total
  @actual_total
end

#breakdownObject

Returns the value of attribute breakdown

Returns:

  • (Object)

    the current value of breakdown



64
65
66
# File 'lib/datagrout_conduit/types.rb', line 64

def breakdown
  @breakdown
end

#estimated_totalObject

Returns the value of attribute estimated_total

Returns:

  • (Object)

    the current value of estimated_total



64
65
66
# File 'lib/datagrout_conduit/types.rb', line 64

def estimated_total
  @estimated_total
end

#net_totalObject

Returns the value of attribute net_total

Returns:

  • (Object)

    the current value of net_total



64
65
66
# File 'lib/datagrout_conduit/types.rb', line 64

def net_total
  @net_total
end

Class Method Details

.from_hash(hash) ⇒ Object



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/datagrout_conduit/types.rb', line 68

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

  hash = hash.transform_keys(&:to_s)
  new(
    estimated_total: hash["estimated_total"]&.to_f,
    actual_total: hash["actual_total"]&.to_f,
    net_total: hash["net_total"]&.to_f,
    breakdown: hash["breakdown"] || {}
  )
end