Class: CouponItem
- Inherits:
-
Object
- Object
- CouponItem
- Defined in:
- lib/order_review.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(item) ⇒ CouponItem
constructor
A new instance of CouponItem.
- #to_s ⇒ Object
Constructor Details
#initialize(item) ⇒ CouponItem
Returns a new instance of CouponItem.
92 93 94 95 |
# File 'lib/order_review.rb', line 92 def initialize(item) self.name = item.css(".useCoupon_coupons_name").text.strip.gsub(/\s+/, " ").sub("\\", "¥") self.value = item.css("dd span").text.strip end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
90 91 92 |
# File 'lib/order_review.rb', line 90 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
90 91 92 |
# File 'lib/order_review.rb', line 90 def value @value end |
Instance Method Details
#to_s ⇒ Object
97 98 99 |
# File 'lib/order_review.rb', line 97 def to_s " #{name} #{value.colorize(:green)}" end |