Class: Remitmd::Reputation

Inherits:
Model
  • Object
show all
Defined in:
lib/remitmd/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#inspect, #to_h

Constructor Details

#initialize(attrs) ⇒ Reputation

Returns a new instance of Reputation.



170
171
172
173
174
175
176
177
178
# File 'lib/remitmd/models.rb', line 170

def initialize(attrs)
  h = attrs.transform_keys(&:to_s)
  @address           = h["wallet"] || h["address"]
  @score             = h["score"].to_i
  @total_paid        = decimal(h["total_paid"])
  @total_received    = decimal(h["total_received"])
  @transaction_count = h["transaction_count"].to_i
  @member_since      = parse_time(h["member_since"])
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



180
181
182
# File 'lib/remitmd/models.rb', line 180

def address
  @address
end

#member_sinceObject (readonly)

Returns the value of attribute member_since.



180
181
182
# File 'lib/remitmd/models.rb', line 180

def member_since
  @member_since
end

#scoreObject (readonly)

Returns the value of attribute score.



180
181
182
# File 'lib/remitmd/models.rb', line 180

def score
  @score
end

#total_paidObject (readonly)

Returns the value of attribute total_paid.



180
181
182
# File 'lib/remitmd/models.rb', line 180

def total_paid
  @total_paid
end

#total_receivedObject (readonly)

Returns the value of attribute total_received.



180
181
182
# File 'lib/remitmd/models.rb', line 180

def total_received
  @total_received
end

#transaction_countObject (readonly)

Returns the value of attribute transaction_count.



180
181
182
# File 'lib/remitmd/models.rb', line 180

def transaction_count
  @transaction_count
end