Class: KongSchema::Actions::Create
- Inherits:
-
Object
- Object
- KongSchema::Actions::Create
- Defined in:
- lib/kong_schema/actions.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(model:, params:) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(model:, params:) ⇒ Create
Returns a new instance of Create.
7 8 9 10 |
# File 'lib/kong_schema/actions.rb', line 7 def initialize(model:, params:) @model = model @params = params end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
5 6 7 |
# File 'lib/kong_schema/actions.rb', line 5 def model @model end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/kong_schema/actions.rb', line 5 def params @params end |
Instance Method Details
#apply ⇒ Object
12 13 14 |
# File 'lib/kong_schema/actions.rb', line 12 def apply(*) @model.create(@params) end |