Class: Plugs::Plug
- Inherits:
-
Object
- Object
- Plugs::Plug
- Defined in:
- lib/plug.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(key:, eager: false, &block) ⇒ Plug
constructor
A new instance of Plug.
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
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/plug.rb', line 5 def key @key end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
5 6 7 |
# File 'lib/plug.rb', line 5 def result @result end |