Class: Coinstack::Pair
- Inherits:
-
Object
- Object
- Coinstack::Pair
- Defined in:
- lib/coinstack/list.rb
Overview
Object representing a single entry of the list
Instance Attribute Summary collapse
-
#added_date ⇒ Object
Returns the value of attribute added_date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#due_date ⇒ Object
Returns the value of attribute due_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#labels ⇒ Object
Returns the value of attribute labels.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Pair
constructor
A new instance of Pair.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Pair
Returns a new instance of Pair.
57 58 59 60 |
# File 'lib/coinstack/list.rb', line 57 def initialize( = {}) .each { |trait, value| public_send("#{trait}=", value) } self.labels ||= [] end |
Instance Attribute Details
#added_date ⇒ Object
Returns the value of attribute added_date.
51 52 53 |
# File 'lib/coinstack/list.rb', line 51 def added_date @added_date end |
#description ⇒ Object
Returns the value of attribute description.
51 52 53 |
# File 'lib/coinstack/list.rb', line 51 def description @description end |
#due_date ⇒ Object
Returns the value of attribute due_date.
51 52 53 |
# File 'lib/coinstack/list.rb', line 51 def due_date @due_date end |
#id ⇒ Object
Returns the value of attribute id.
51 52 53 |
# File 'lib/coinstack/list.rb', line 51 def id @id end |
#labels ⇒ Object
Returns the value of attribute labels.
51 52 53 |
# File 'lib/coinstack/list.rb', line 51 def labels @labels end |
Instance Method Details
#to_h ⇒ Object
66 67 68 |
# File 'lib/coinstack/list.rb', line 66 def to_h end |
#to_s ⇒ Object
62 63 64 |
# File 'lib/coinstack/list.rb', line 62 def to_s description.to_s.capitalize + " | Due: #{due_date}" end |