Class: Fortnox::API::Repository::Base::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/fortnox/api/repositories/base/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, json_collection_wrapper:, json_entity_wrapper:, unique_id:, attribute_name_to_json_key_map: {}, keys_filtered_on_save: [ :url ]) ⇒ Options

Returns a new instance of Options.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/fortnox/api/repositories/base/options.rb', line 11

def initialize(
      uri:,
      json_collection_wrapper:,
      json_entity_wrapper:,
      unique_id:,
      attribute_name_to_json_key_map: {},
      keys_filtered_on_save: [ :url ]
    )

  @uri = uri
  @json_collection_wrapper = json_collection_wrapper
  @json_entity_wrapper = json_entity_wrapper
  @unique_id = unique_id
  @attr_to_json_map = attribute_name_to_json_key_map
  @json_to_attr_map = @attr_to_json_map.invert
  @keys_filtered_on_save = keys_filtered_on_save
end

Instance Attribute Details

#attr_to_json_mapObject

Returns the value of attribute attr_to_json_map.



7
8
9
# File 'lib/fortnox/api/repositories/base/options.rb', line 7

def attr_to_json_map
  @attr_to_json_map
end

#json_collection_wrapperObject

Returns the value of attribute json_collection_wrapper.



7
8
9
# File 'lib/fortnox/api/repositories/base/options.rb', line 7

def json_collection_wrapper
  @json_collection_wrapper
end

#json_entity_wrapperObject

Returns the value of attribute json_entity_wrapper.



7
8
9
# File 'lib/fortnox/api/repositories/base/options.rb', line 7

def json_entity_wrapper
  @json_entity_wrapper
end

#json_to_attr_mapObject

Returns the value of attribute json_to_attr_map.



7
8
9
# File 'lib/fortnox/api/repositories/base/options.rb', line 7

def json_to_attr_map
  @json_to_attr_map
end

#keys_filtered_on_saveObject

Returns the value of attribute keys_filtered_on_save.



7
8
9
# File 'lib/fortnox/api/repositories/base/options.rb', line 7

def keys_filtered_on_save
  @keys_filtered_on_save
end

#unique_idObject

Returns the value of attribute unique_id.



7
8
9
# File 'lib/fortnox/api/repositories/base/options.rb', line 7

def unique_id
  @unique_id
end

#uriObject

Returns the value of attribute uri.



7
8
9
# File 'lib/fortnox/api/repositories/base/options.rb', line 7

def uri
  @uri
end