Class: Rivendell::Import::Cart::Updater
- Inherits:
-
Object
- Object
- Rivendell::Import::Cart::Updater
- Defined in:
- lib/rivendell/import/cart.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cart ⇒ Object
Returns the value of attribute cart.
Instance Method Summary collapse
- #empty_title?(title) ⇒ Boolean
-
#initialize(cart) ⇒ Updater
constructor
A new instance of Updater.
- #title_with_default ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(cart) ⇒ Updater
Returns a new instance of Updater.
74 75 76 |
# File 'lib/rivendell/import/cart.rb', line 74 def initialize(cart) @cart = cart end |
Instance Attribute Details
#cart ⇒ Object
Returns the value of attribute cart.
72 73 74 |
# File 'lib/rivendell/import/cart.rb', line 72 def cart @cart end |
Instance Method Details
#empty_title?(title) ⇒ Boolean
79 80 81 |
# File 'lib/rivendell/import/cart.rb', line 79 def empty_title?(title) [ nil, "", "[new cart]" ].include? title end |
#title_with_default ⇒ Object
83 84 85 86 87 88 89 90 |
# File 'lib/rivendell/import/cart.rb', line 83 def title_with_default @title_with_default ||= if title title else default_title if default_title && empty_title?(current_title) end end |