Class: Coinstack::Pair

Inherits:
Object
  • Object
show all
Defined in:
lib/coinstack/list.rb

Overview

Object representing a single entry of the list

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Pair

Returns a new instance of Pair.



57
58
59
60
# File 'lib/coinstack/list.rb', line 57

def initialize(options = {})
  options.each { |trait, value| public_send("#{trait}=", value) }
  self.labels ||= []
end

Instance Attribute Details

#added_dateObject

Returns the value of attribute added_date.



51
52
53
# File 'lib/coinstack/list.rb', line 51

def added_date
  @added_date
end

#descriptionObject

Returns the value of attribute description.



51
52
53
# File 'lib/coinstack/list.rb', line 51

def description
  @description
end

#due_dateObject

Returns the value of attribute due_date.



51
52
53
# File 'lib/coinstack/list.rb', line 51

def due_date
  @due_date
end

#idObject

Returns the value of attribute id.



51
52
53
# File 'lib/coinstack/list.rb', line 51

def id
  @id
end

#labelsObject

Returns the value of attribute labels.



51
52
53
# File 'lib/coinstack/list.rb', line 51

def labels
  @labels
end

Instance Method Details

#to_hObject



66
67
68
# File 'lib/coinstack/list.rb', line 66

def to_h

end

#to_sObject



62
63
64
# File 'lib/coinstack/list.rb', line 62

def to_s
  description.to_s.capitalize + " | Due: #{due_date}"
end