Class: Low::Provider
- Inherits:
-
Object
- Object
- Low::Provider
- Defined in:
- lib/models/provider.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key:, &block) ⇒ Provider
constructor
A new instance of Provider.
- #result ⇒ Object
Constructor Details
#initialize(key:, &block) ⇒ Provider
Returns a new instance of Provider.
7 8 9 10 11 |
# File 'lib/models/provider.rb', line 7 def initialize(key:, &block) @key = key @proc = block @result = nil end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/models/provider.rb', line 5 def key @key end |
Instance Method Details
#result ⇒ Object
13 14 15 |
# File 'lib/models/provider.rb', line 13 def result @result ||= @proc.call end |