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

Inherits:
Base
  • Object
show all
Includes:
Loaders, Savers
Defined in:
lib/fortnox/api/repositories/base.rb

Direct Known Subclasses

Customer, Invoice, Order

Constant Summary

Constants inherited from Base

Base::DEFAULT_HEADERS, Base::HTTP_METHODS

Instance Attribute Summary collapse

Attributes inherited from Base

#headers

Instance Method Summary collapse

Methods included from Savers

#save

Methods included from Loaders

#all, #escape, #find, #find_one_by, #only, #search, #to_query

Methods included from ClassMethods

#get_access_token, #set_headers

Constructor Details

#initialize(keys_filtered_on_save: [ :url ]) ⇒ Base

Returns a new instance of Base.



15
16
17
18
19
20
# File 'lib/fortnox/api/repositories/base.rb', line 15

def initialize( keys_filtered_on_save: [ :url ] )
  super()

  @keys_filtered_on_save = keys_filtered_on_save
  @mapper = Registry[ Mapper::Base.canonical_name_sym( self.class::MODEL )].new
end

Instance Attribute Details

#keys_filtered_on_saveObject (readonly)

Returns the value of attribute keys_filtered_on_save.



13
14
15
# File 'lib/fortnox/api/repositories/base.rb', line 13

def keys_filtered_on_save
  @keys_filtered_on_save
end

#mapperObject (readonly)

Returns the value of attribute mapper.



13
14
15
# File 'lib/fortnox/api/repositories/base.rb', line 13

def mapper
  @mapper
end