Class: Plugs::Plug

Inherits:
Object
  • Object
show all
Defined in:
lib/plug.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, eager: false, &block) ⇒ Plug

Returns a new instance of Plug.



7
8
9
10
11
# File 'lib/plug.rb', line 7

def initialize(key:, eager: false, &block)
  @key = key
  @proc = block
  @result = eager ? block.call : nil
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/plug.rb', line 5

def key
  @key
end

#resultObject (readonly)

Returns the value of attribute result.



5
6
7
# File 'lib/plug.rb', line 5

def result
  @result
end