Module: Sandwich::Model::Machinist
- Includes:
- Base
- Defined in:
- lib/sandwich/model/machinist.rb
Defined Under Namespace
Modules: Extensions Classes: Materializer
Instance Method Summary collapse
- #record(name, args) ⇒ Object
-
#record!(name, args) ⇒ Object
Create a record.
Methods included from Base
Instance Method Details
#record(name, args) ⇒ Object
99 100 101 102 103 104 105 |
# File 'lib/sandwich/model/machinist.rb', line 99 def record(name, args) materializer = Materializer[name] raise ModelNotFoundError, "No model found for '#{name}'" if materializer.nil? materializer.get(args) end |
#record!(name, args) ⇒ Object
Create a record
91 92 93 94 95 96 97 |
# File 'lib/sandwich/model/machinist.rb', line 91 def record!(name, args) materializer = Materializer[name] raise ModelNotFoundError, "No model found for '#{name}'" if materializer.nil? materializer.create(args) end |