Class: Gratitude::Payday

Inherits:
Object
  • Object
show all
Extended by:
Connection
Defined in:
lib/gratitude/payday.rb

Constant Summary collapse

PAYDAYS =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Connection

faraday

Constructor Details

#initialize(options = {}) ⇒ Payday

Returns a new instance of Payday.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/gratitude/payday.rb', line 31

def initialize(options = {})
  @ach_fees_volume = options["ach_fees_volume"]
  @ach_volume = options["ach_volume"]
  @charge_fees_volume = options["charge_fees_volume"]
  @charge_volume = options["charge_volume"]
  @number_of_ach_credits = options["nachs"]
  @number_of_active_users = options["nactive"]
  @number_of_failing_credit_cards = options["ncc_failing"]
  @number_of_missing_credit_cards = options["ncc_missing"]
  @number_of_charges = options["ncharges"]
  @number_of_participants = options["nparticipants"]
  @number_of_tippers = options["ntippers"]
  @number_of_transfers = options["ntransfers"]
  @transfer_volume = options["transfer_volume"]
  if options["ts_end"]
    @transfer_end_time = DateTime.parse(options["ts_end"])
  end
  if options["ts_start"]
    @transfer_start_time = DateTime.parse(options["ts_start"])
  end
  PAYDAYS << self
end

Instance Attribute Details

#ach_fees_volumeObject (readonly)

Returns the value of attribute ach_fees_volume.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def ach_fees_volume
  @ach_fees_volume
end

#ach_volumeObject (readonly)

Returns the value of attribute ach_volume.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def ach_volume
  @ach_volume
end

#charge_fees_volumeObject (readonly)

Returns the value of attribute charge_fees_volume.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def charge_fees_volume
  @charge_fees_volume
end

#charge_volumeObject (readonly)

Returns the value of attribute charge_volume.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def charge_volume
  @charge_volume
end

#number_of_ach_creditsObject (readonly) Also known as: nachs, number_of_achs

Returns the value of attribute number_of_ach_credits.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_ach_credits
  @number_of_ach_credits
end

#number_of_active_usersObject (readonly) Also known as: nactive, number_active

Returns the value of attribute number_of_active_users.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_active_users
  @number_of_active_users
end

#number_of_chargesObject (readonly) Also known as: ncharges

Returns the value of attribute number_of_charges.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_charges
  @number_of_charges
end

#number_of_failing_credit_cardsObject (readonly) Also known as: ncc_failing

Returns the value of attribute number_of_failing_credit_cards.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_failing_credit_cards
  @number_of_failing_credit_cards
end

#number_of_missing_credit_cardsObject (readonly) Also known as: ncc_missing

Returns the value of attribute number_of_missing_credit_cards.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_missing_credit_cards
  @number_of_missing_credit_cards
end

#number_of_participantsObject (readonly) Also known as: nparticipants

Returns the value of attribute number_of_participants.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_participants
  @number_of_participants
end

#number_of_tippersObject (readonly) Also known as: ntippers

Returns the value of attribute number_of_tippers.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_tippers
  @number_of_tippers
end

#number_of_transfersObject (readonly) Also known as: ntransfers

Returns the value of attribute number_of_transfers.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def number_of_transfers
  @number_of_transfers
end

#transfer_end_timeObject (readonly) Also known as: ts_end

Returns the value of attribute transfer_end_time.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def transfer_end_time
  @transfer_end_time
end

#transfer_start_timeObject (readonly) Also known as: ts_start

Returns the value of attribute transfer_start_time.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def transfer_start_time
  @transfer_start_time
end

#transfer_volumeObject (readonly)

Returns the value of attribute transfer_volume.



8
9
10
# File 'lib/gratitude/payday.rb', line 8

def transfer_volume
  @transfer_volume
end

Class Method Details

.allObject

Class Methods



55
56
57
58
# File 'lib/gratitude/payday.rb', line 55

def self.all
  collect_paydays if PAYDAYS.empty?
  PAYDAYS
end

.newestObject



60
61
62
# File 'lib/gratitude/payday.rb', line 60

def self.newest
  sort_by_ts_end.first
end

.oldestObject



64
65
66
# File 'lib/gratitude/payday.rb', line 64

def self.oldest
  sort_by_ts_end.last
end