Class: Mt::Wall::Plan::Operation

Inherits:
Data
  • Object
show all
Defined in:
lib/mt/wall/plan.rb

Overview

A single change to apply to a device.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, path:, payload: {}, position: nil) ⇒ Operation

Returns a new instance of Operation.



54
55
56
# File 'lib/mt/wall/plan.rb', line 54

def initialize(action:, path:, payload: {}, position: nil)
  super
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



53
54
55
# File 'lib/mt/wall/plan.rb', line 53

def action
  @action
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



53
54
55
56
57
# File 'lib/mt/wall/plan.rb', line 53

Operation = Data.define(:action, :path, :payload, :position) do
  def initialize(action:, path:, payload: {}, position: nil)
    super
  end
end

#payloadObject (readonly)

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



53
54
55
# File 'lib/mt/wall/plan.rb', line 53

def payload
  @payload
end

#positionObject (readonly)

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



53
54
55
56
57
# File 'lib/mt/wall/plan.rb', line 53

Operation = Data.define(:action, :path, :payload, :position) do
  def initialize(action:, path:, payload: {}, position: nil)
    super
  end
end

Instance Method Details

#action=(value) ⇒ Object (readonly)

:create, :update, :delete or :move



53
54
55
56
57
# File 'lib/mt/wall/plan.rb', line 53

Operation = Data.define(:action, :path, :payload, :position) do
  def initialize(action:, path:, payload: {}, position: nil)
    super
  end
end

#payload=(value) ⇒ Object (readonly)

the resource attributes; for :update/:delete/:move it also carries the existing row’s ‘.id`



53
54
55
56
57
# File 'lib/mt/wall/plan.rb', line 53

Operation = Data.define(:action, :path, :payload, :position) do
  def initialize(action:, path:, payload: {}, position: nil)
    super
  end
end