Module: Paggi::Rest::GetAll

Included in:
Payment
Defined in:
lib/paggi/rest/get_all.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/paggi/rest/get_all.rb', line 6

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

Instance Method Details

#get_allObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/paggi/rest/get_all.rb', line 11

def get_all
  result = self.class.get_all(self.to_json)
  raise result if result.instance_of? StandardError

  if result.instance_of? PaggiError
    self.errors = result.errors
    return false
  end

  initialize(result.to_json)
  true
end