Sha256: 159c4d183ea43a24070c925aa41909b457fcbb1dc7ab930f9529b91afec36c53

Contents?: true

Size: 540 Bytes

Versions: 2

Compression:

Stored size: 540 Bytes

Contents

module Fastbill
  module Automatic
    module Services
      module Cancel
        module ClassMethods

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastbill-automatic-0.0.4 lib/fastbill-automatic/services/cancel.rb
fastbill-automatic-0.0.3 lib/fastbill-automatic/services/cancel.rb