Class: Invofox::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/invofox/resource.rb

Direct Known Subclasses

Company, Document, LoadBatch

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Resource

Returns a new instance of Resource.



2
3
4
5
# File 'lib/invofox/resource.rb', line 2

def initialize(data)
  generate_attr_readers
  set_data(data)
end

Class Method Details

.fields_informationObject



47
48
49
# File 'lib/invofox/resource.rb', line 47

def fields_information
  @fields_information
end

.has_fields(fields_information) ⇒ Object



51
52
53
# File 'lib/invofox/resource.rb', line 51

def has_fields(fields_information)
  @fields_information = fields_information.merge("_id" => :string)
end

Instance Method Details

#fields_informationObject



7
8
9
# File 'lib/invofox/resource.rb', line 7

def fields_information
  self.class.fields_information
end