Class: Pears::Provider::Base
- Inherits:
-
Object
- Object
- Pears::Provider::Base
show all
- Defined in:
- lib/pears/provider/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(data, on_failure: :raise) ⇒ Base
Returns a new instance of Base.
6
7
8
|
# File 'lib/pears/provider/base.rb', line 6
def initialize(data, on_failure: :raise)
@data = data
end
|
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4
5
6
|
# File 'lib/pears/provider/base.rb', line 4
def data
@data
end
|
Instance Method Details
#[](key) ⇒ Object
18
19
20
|
# File 'lib/pears/provider/base.rb', line 18
def [](key)
@data[key]
end
|
#each(&block) ⇒ Object
14
15
16
|
# File 'lib/pears/provider/base.rb', line 14
def each(&block)
@data.block(&:yield)
end
|
#has_key?(key) ⇒ Boolean
10
11
12
|
# File 'lib/pears/provider/base.rb', line 10
def has_key?(key)
@data.has_key? key
end
|
#purge ⇒ Object
22
23
24
|
# File 'lib/pears/provider/base.rb', line 22
def purge
true
end
|