Class: Low::Provider

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

Instance Method Details

#resultObject



13
14
15
# File 'lib/models/provider.rb', line 13

def result
  @result ||= @proc.call
end