Class: Omise::DocumentList

Inherits:
List show all
Defined in:
lib/omise/document_list.rb

Instance Method Summary collapse

Methods inherited from List

#each, #first_page?, #initialize, #jump_to_page, #last, #last_page?, #next_page, #page, #parent, #previous_page, #reload, #to_a, #total_pages

Methods inherited from OmiseObject

location, resource

Methods included from Attributes

#[], #as_json, #assign_attributes, #attributes, #destroyed?, #initialize, #key?, #location, #method_missing, #respond_to?

Constructor Details

This class inherits a constructor from Omise::List

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Omise::Attributes

Instance Method Details

#retrieve(id, attributes = {}) ⇒ Object



6
7
8
# File 'lib/omise/document_list.rb', line 6

def retrieve(id, attributes = {})
  Document.new self.class.resource(location(id), attributes).get(attributes)
end

#upload(file) ⇒ Object



10
11
12
13
# File 'lib/omise/document_list.rb', line 10

def upload(file)
  attributes = { file: file }
  Document.new self.class.resource(location, attributes).post(attributes)
end