Class: AlwaysBeContributing::Contribution
- Inherits:
-
Struct
- Object
- Struct
- AlwaysBeContributing::Contribution
- Defined in:
- lib/always_be_contributing/contribution.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(date, value) ⇒ Contribution
constructor
A new instance of Contribution.
- #nil? ⇒ Boolean
Constructor Details
#initialize(date, value) ⇒ Contribution
Returns a new instance of Contribution.
9 10 11 12 |
# File 'lib/always_be_contributing/contribution.rb', line 9 def initialize(date, value) self.date = Date.parse(date) self.value = value end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date
4 5 6 |
# File 'lib/always_be_contributing/contribution.rb', line 4 def date @date end |
#value ⇒ Object
Returns the value of attribute value
4 5 6 |
# File 'lib/always_be_contributing/contribution.rb', line 4 def value @value end |
Class Method Details
.from_raw(raw) ⇒ Object
5 6 7 |
# File 'lib/always_be_contributing/contribution.rb', line 5 def self.from_raw(raw) AlwaysBeContributing::Contribution.new(raw[0],raw[1]) end |
Instance Method Details
#nil? ⇒ Boolean
14 15 16 |
# File 'lib/always_be_contributing/contribution.rb', line 14 def nil? self.date.nil? || self.value.nil? end |