Class: Serega::SeregaPlugins::If::KeywordConditionResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/plugins/if/if.rb

Overview

Resolves keyword-based conditions for if/unless options

Instance Method Summary collapse

Constructor Details

#initialize(keyword) ⇒ KeywordConditionResolver

Returns a new instance of KeywordConditionResolver.



142
143
144
# File 'lib/serega/plugins/if/if.rb', line 142

def initialize(keyword)
  @keyword = keyword
end

Instance Method Details

#call(object) ⇒ Object

Calls the keyword method on the object

Parameters:

  • object (Object)

    the object to call method on

Returns:

  • (Object)

    result of method call



152
153
154
# File 'lib/serega/plugins/if/if.rb', line 152

def call(object)
  object.public_send(@keyword)
end