Sha256: 8042c68afab10971a72599ba0a324abf6648e73d7596da264907f76c7de7ab34

Contents?: true

Size: 556 Bytes

Versions: 2

Compression:

Stored size: 556 Bytes

Contents

module Fastbill
  module Automatic
    module Services
      module Sign
        module ClassMethods

          def sign(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}.sign", attributes)
            self.new(response["data"])
          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/sign.rb
fastbill-automatic-0.0.3 lib/fastbill-automatic/services/sign.rb