Class: Rivendell::Import::Cart::ApiUpdater

Inherits:
Updater
  • Object
show all
Defined in:
lib/rivendell/import/cart.rb

Instance Attribute Summary

Attributes inherited from Updater

#cart

Instance Method Summary collapse

Methods inherited from Updater

#empty_title?, #initialize, #title_with_default, #update

Constructor Details

This class inherits a constructor from Rivendell::Import::Cart::Updater

Instance Method Details

#attributesObject



120
121
122
123
124
# File 'lib/rivendell/import/cart.rb', line 120

def attributes
  {}.tap do |attributes|
    attributes[:title] = title_with_default if title_with_default
  end
end

#current_titleObject



116
117
118
# File 'lib/rivendell/import/cart.rb', line 116

def current_title
  xport.list_cart(number).title
end

#update!Object



105
106
107
108
109
110
111
112
# File 'lib/rivendell/import/cart.rb', line 105

def update!
  unless attributes.empty?
    Rivendell::Import.logger.debug "Update Cart by API : #{attributes}"
    xport.edit_cart number, attributes
  else
    true
  end
end