Class: KongSchema::Actions::Update

Inherits:
Object
  • Object
show all
Defined in:
lib/kong_schema/actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#modelObject (readonly)

Returns the value of attribute model.



18
19
20
# File 'lib/kong_schema/actions.rb', line 18

def model
  @model
end

#paramsObject (readonly)

Returns the value of attribute params.



18
19
20
# File 'lib/kong_schema/actions.rb', line 18

def params
  @params
end

#recordObject (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

#applyObject



26
27
28
# File 'lib/kong_schema/actions.rb', line 26

def apply(*)
  @model.update(@record, @params)
end