Class: UCCard::ShoppingData
- Inherits:
-
Object
- Object
- UCCard::ShoppingData
- Defined in:
- lib/uc_card.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
Returns the value of attribute name.
-
#note ⇒ Object
Returns the value of attribute note.
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#times ⇒ Object
Returns the value of attribute times.
-
#usecase ⇒ Object
Returns the value of attribute usecase.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ShoppingData
constructor
A new instance of ShoppingData.
- #money ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ShoppingData
Returns a new instance of ShoppingData.
102 103 104 105 106 |
# File 'lib/uc_card.rb', line 102 def initialize(={}) .each{ |k,v| self.send("#{k.to_s}=", v) } end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
93 94 95 |
# File 'lib/uc_card.rb', line 93 def date @date end |
#klass ⇒ Object
Returns the value of attribute klass.
94 95 96 |
# File 'lib/uc_card.rb', line 94 def klass @klass end |
#name ⇒ Object
Returns the value of attribute name.
95 96 97 |
# File 'lib/uc_card.rb', line 95 def name @name end |
#note ⇒ Object
Returns the value of attribute note.
99 100 101 |
# File 'lib/uc_card.rb', line 99 def note @note end |
#payment ⇒ Object
Returns the value of attribute payment.
100 101 102 |
# File 'lib/uc_card.rb', line 100 def payment @payment end |
#times ⇒ Object
Returns the value of attribute times.
98 99 100 |
# File 'lib/uc_card.rb', line 98 def times @times end |
#usecase ⇒ Object
Returns the value of attribute usecase.
97 98 99 |
# File 'lib/uc_card.rb', line 97 def usecase @usecase end |
#value ⇒ Object
Returns the value of attribute value.
96 97 98 |
# File 'lib/uc_card.rb', line 96 def value @value end |
Instance Method Details
#money ⇒ Object
108 109 110 |
# File 'lib/uc_card.rb', line 108 def money @value.gsub(/\D/, '').to_i end |
#to_s ⇒ Object
112 113 114 115 |
# File 'lib/uc_card.rb', line 112 def to_s #"#{date}: " + [@date, @klass, @name, @value, @usecase, @times, @note, @payment].join(',') "#{@date}: #{@name} #{money} #{@usecase} #{@times}" end |