Module: AssayDepot::DatabaseModel

Included in:
List, PurchaseOrder
Defined in:
lib/assaydepot/model.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



10
11
12
13
14
# File 'lib/assaydepot/model.rb', line 10

def self.included(base)
  base.include AssayDepot::Model
  base.extend AssayDepot::Model::ClassMethods
  base.extend ClassMethods
end

Instance Method Details

#all(options = {}) ⇒ Object



16
17
18
19
20
# File 'lib/assaydepot/model.rb', line 16

def all(options = {})
  result = self.clone
  result.internal_options = options
  result
end

#internal_resultsObject

Overridden from Model



23
24
25
26
27
28
# File 'lib/assaydepot/model.rb', line 23

def internal_results
  unless @internal_results
    @internal_results = JSON.parse(Client.new(endpoint: self.class.endpoint(nil)).get(params: @internal_options))
  end
  @internal_results
end