Class: MimiCheck::Generator::Wrapper

Inherits:
Object
  • Object
show all
Includes:
MimiCheck::Generator
Defined in:
lib/mimicheck/generator/wrapper.rb

Instance Method Summary collapse

Methods included from MimiCheck::Generator

#call, #to_proc

Constructor Details

#initialize(element) ⇒ Wrapper

Returns a new instance of Wrapper.



6
7
8
# File 'lib/mimicheck/generator/wrapper.rb', line 6

def initialize(element)
  @element = element
end

Instance Method Details

#generateObject



12
13
14
15
# File 'lib/mimicheck/generator/wrapper.rb', line 12

def generate
  return element unless element.respond_to?(:call)
  element.call
end