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

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

Instance Method Summary collapse

Instance Method Details

#base_moduleObject



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

def base_module
  self.class.base_module
end

#ledger_attributes_to_saveObject



30
31
32
33
34
35
36
# File 'lib/ledger_sync/ledgers/client.rb', line 30

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



26
27
28
# File 'lib/ledger_sync/ledgers/client.rb', line 26

def ledger_configuration
  self.class.config
end

#operation_for(args = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/ledger_sync/ledgers/client.rb', line 38

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



67
68
69
# File 'lib/ledger_sync/ledgers/client.rb', line 67

def parse_operation_error(*)
  nil
end

#searcher_class_for(*args, **keywords) ⇒ Object



59
60
61
# File 'lib/ledger_sync/ledgers/client.rb', line 59

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

#searcher_for(resource_type:, query: '') ⇒ Object



51
52
53
54
55
56
57
# File 'lib/ledger_sync/ledgers/client.rb', line 51

def searcher_for(resource_type:, query: '')
  self.class.searcher_for(
    resource_type: resource_type,
    client: self,
    query: query
  )
end

#update_secrets_in_dotenvObject



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

def update_secrets_in_dotenv
  return if ENV['TEST_ENV'] && !ENV['USE_DOTENV_ADAPTOR_SECRETS']

  Util::DotenvUpdator.new.update(client: self)
end

#url_for(*_args) ⇒ Object

Raises:

  • (NotImplementedError)


63
64
65
# File 'lib/ledger_sync/ledgers/client.rb', line 63

def url_for(*_args)
  raise NotImplementedError
end