Module: Fastbill::Automatic::Services::Update

Included in:
Customer, Invoice, Fastbill::Automatic::Subscription
Defined in:
lib/fastbill-automatic/services/update.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



15
16
17
# File 'lib/fastbill-automatic/services/update.rb', line 15

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#update_attributes(attributes) ⇒ Object



19
20
21
22
23
24
# File 'lib/fastbill-automatic/services/update.rb', line 19

def update_attributes(attributes)
  id_attribute = "#{self.class.name.split("::").last.downcase}_id".to_sym
  attributes[id_attribute] = self.send(id_attribute)
  response = Fastbill::Automatic.request("#{self.class.name.split("::").last.downcase}.update", attributes)
  true
end