Module: LedgerSync::Ledgers::Client::Mixin::InstanceMethods

Defined in:
lib/ledger_sync/ledgers/client.rb

Instance Method Summary collapse

Instance Method Details

#base_moduleObject



20
21
22
# File 'lib/ledger_sync/ledgers/client.rb', line 20

def base_module
  self.class.base_module
end

#ledger_attributes_to_saveObject



24
25
26
27
28
29
30
# File 'lib/ledger_sync/ledgers/client.rb', line 24

def ledger_attributes_to_save
  return {} if self.class.ledger_attributes_to_save.nil?

  Hash[self.class.ledger_attributes_to_save.map do |attribute|
    [attribute, send(attribute)]
  end]
end

#ledger_configurationObject



16
17
18
# File 'lib/ledger_sync/ledgers/client.rb', line 16

def ledger_configuration
  self.class.config
end

#operation_for(args = {}) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ledger_sync/ledgers/client.rb', line 32

def operation_for(args = {})
  method = args.fetch(:method)
  resource = args.fetch(:resource)

  self.class.operation_class_for(
    method: method,
    resource_class: resource.class
  ).new(
    client: self,
    resource: resource
  )
end

#parse_operation_errorObject



57
58
59
# File 'lib/ledger_sync/ledgers/client.rb', line 57

def parse_operation_error(*)
  nil
end

#searcher_class_for(*args) ⇒ Object



49
50
51
# File 'lib/ledger_sync/ledgers/client.rb', line 49

def searcher_class_for(*args)
  self.class.searcher_class_for(*args)
end

#searcher_for(*args) ⇒ Object



45
46
47
# File 'lib/ledger_sync/ledgers/client.rb', line 45

def searcher_for(*args)
  self.class.searcher_for(*args)
end

#url_for(*_args) ⇒ Object

Raises:

  • (NotImplementedError)


53
54
55
# File 'lib/ledger_sync/ledgers/client.rb', line 53

def url_for(*_args)
  raise NotImplementedError
end