Module: Arfy::EnvironmentFaker

Defined in:
lib/arfy/environment.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(who_ami, *params) ⇒ Object



171
172
173
174
175
176
177
178
179
# File 'lib/arfy/environment.rb', line 171

def method_missing(who_ami, *params)
  method = who_ami.to_s
  ends_with_questionmark = method.index("?") == method.length - 1
  if ends_with_questionmark
    env_name_asked = method.slice(0, method.length-1)
    return env_name_asked == ENV['RAILS_ENV'] || self.env
  end
  super
end