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.



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

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



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

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