Class: Servactory::Actions::Action

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, position:, **options) ⇒ Action

Returns a new instance of Action.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/servactory/actions/action.rb', line 11

def initialize(name, position:, **options)
  @name = name
  @position = position

  @is_condition_opposite = false
  @condition = options.fetch(:if, nil)

  return unless @condition.nil?

  @condition = options.fetch(:unless, nil)

  @is_condition_opposite = true unless @condition.nil?
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



6
7
8
# File 'lib/servactory/actions/action.rb', line 6

def condition
  @condition
end

#is_condition_oppositeObject (readonly)

Returns the value of attribute is_condition_opposite.



6
7
8
# File 'lib/servactory/actions/action.rb', line 6

def is_condition_opposite
  @is_condition_opposite
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/servactory/actions/action.rb', line 6

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



6
7
8
# File 'lib/servactory/actions/action.rb', line 6

def position
  @position
end