Class: KongSchema::Actions::Update
- Inherits:
-
Object
- Object
- KongSchema::Actions::Update
- 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.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(model:, record:, params:) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(model:, record:, params:) ⇒ Update
Returns a new instance of Update.
20 21 22 23 24 |
# File 'lib/kong_schema/actions.rb', line 20 def initialize(model:, record:, params:) @model = model @params = params @record = record end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
18 19 20 |
# File 'lib/kong_schema/actions.rb', line 18 def model @model end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
18 19 20 |
# File 'lib/kong_schema/actions.rb', line 18 def params @params end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
18 19 20 |
# File 'lib/kong_schema/actions.rb', line 18 def record @record end |
Instance Method Details
#apply ⇒ Object
26 27 28 |
# File 'lib/kong_schema/actions.rb', line 26 def apply(*) @model.update(@record, @params) end |