Class: Gratitude::Chart
- Inherits:
-
Object
- Object
- Gratitude::Chart
- Extended by:
- Connection
- Defined in:
- lib/gratitude/chart.rb
Constant Summary collapse
- CHARTS =
[]
Instance Attribute Summary collapse
-
#active_users ⇒ Object
readonly
Returns the value of attribute active_users.
-
#charges ⇒ Object
readonly
Returns the value of attribute charges.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#total_gifts ⇒ Object
readonly
Returns the value of attribute total_gifts.
-
#total_users ⇒ Object
readonly
Returns the value of attribute total_users.
-
#weekly_gifts ⇒ Object
readonly
Returns the value of attribute weekly_gifts.
-
#withdrawals ⇒ Object
readonly
Returns the value of attribute withdrawals.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Chart
constructor
A new instance of Chart.
Methods included from Connection
Constructor Details
#initialize(options = {}) ⇒ Chart
Returns a new instance of Chart.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gratitude/chart.rb', line 11 def initialize( = {}) @active_users = ["active_users"] @charges = ["charges"] @date = Date.parse(["date"]) if ["date"] @total_gifts = ["total_gifts"] @total_users = ["total_users"] @weekly_gifts = ["weekly_gifts"] @withdrawals = ["withdrawals"] CHARTS << self end |
Instance Attribute Details
#active_users ⇒ Object (readonly)
Returns the value of attribute active_users.
8 9 10 |
# File 'lib/gratitude/chart.rb', line 8 def active_users @active_users end |
#charges ⇒ Object (readonly)
Returns the value of attribute charges.
8 9 10 |
# File 'lib/gratitude/chart.rb', line 8 def charges @charges end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
8 9 10 |
# File 'lib/gratitude/chart.rb', line 8 def date @date end |
#total_gifts ⇒ Object (readonly)
Returns the value of attribute total_gifts.
8 9 10 |
# File 'lib/gratitude/chart.rb', line 8 def total_gifts @total_gifts end |
#total_users ⇒ Object (readonly)
Returns the value of attribute total_users.
8 9 10 |
# File 'lib/gratitude/chart.rb', line 8 def total_users @total_users end |
#weekly_gifts ⇒ Object (readonly)
Returns the value of attribute weekly_gifts.
8 9 10 |
# File 'lib/gratitude/chart.rb', line 8 def weekly_gifts @weekly_gifts end |
#withdrawals ⇒ Object (readonly)
Returns the value of attribute withdrawals.
8 9 10 |
# File 'lib/gratitude/chart.rb', line 8 def withdrawals @withdrawals end |
Class Method Details
.all ⇒ Object
22 23 24 25 |
# File 'lib/gratitude/chart.rb', line 22 def self.all collect_charts if CHARTS.empty? CHARTS end |
.newest ⇒ Object
27 28 29 |
# File 'lib/gratitude/chart.rb', line 27 def self.newest sort_by_date.first end |
.oldest ⇒ Object
31 32 33 |
# File 'lib/gratitude/chart.rb', line 31 def self.oldest sort_by_date.last end |