Class: KongSchema::Actions::Create

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#modelObject (readonly)

Returns the value of attribute model.



5
6
7
# File 'lib/kong_schema/actions.rb', line 5

def model
  @model
end

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

#applyObject



12
13
14
# File 'lib/kong_schema/actions.rb', line 12

def apply(*)
  @model.create(@params)
end