Class: Pears::Provider::Base

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

Direct Known Subclasses

Debuggy, ENV, Hash, LocalFile, Loco, RailsConfig, RemoteFile, Subscription

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

#dataObject

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

Returns:

  • (Boolean)


10
11
12
# File 'lib/pears/provider/base.rb', line 10

def has_key?(key)
  @data.has_key? key
end

#purgeObject



22
23
24
# File 'lib/pears/provider/base.rb', line 22

def purge
  true
end