Class: Dina::Collection

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/dina/models/material_sample/collection.rb

Class Method Summary collapse

Methods inherited from BaseModel

custom_headers, find_by_group, #initialize, properties, site

Constructor Details

This class inherits a constructor from Dina::BaseModel

Class Method Details

.endpoint_pathObject



23
24
25
# File 'lib/dina/models/material_sample/collection.rb', line 23

def self.endpoint_path
  "collection-api/"
end

.find_by_code(code:) ⇒ Object

Finds a Collection object by code

Parameters:



43
44
45
# File 'lib/dina/models/material_sample/collection.rb', line 43

def self.find_by_code(code:)
  where(code: code).all
end

.find_by_name(name) ⇒ Object

Finds a Collection object by name

Parameters:



35
36
37
# File 'lib/dina/models/material_sample/collection.rb', line 35

def self.find_by_name(name)
  where(name: name).all
end

.table_nameObject



27
28
29
# File 'lib/dina/models/material_sample/collection.rb', line 27

def self.table_name
  "collection"
end