Class: Payola::EnvWrapper

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

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ EnvWrapper

Returns a new instance of EnvWrapper.



131
132
133
# File 'lib/payola.rb', line 131

def initialize(key)
  @key = key
end

Instance Method Details

#==(other) ⇒ Object



139
140
141
# File 'lib/payola.rb', line 139

def ==(other)
  to_s == other.to_s
end

#is_a?(other) ⇒ Boolean

This is a nasty hack to counteract Stripe checking if the API key is_a String See github.com/peterkeen/payola/issues/256 for details

Returns:

  • (Boolean)


145
146
147
# File 'lib/payola.rb', line 145

def is_a?(other)
  ENV[@key].is_a?(other)
end

#to_sObject



135
136
137
# File 'lib/payola.rb', line 135

def to_s
  ENV[@key]
end