Class: ResponseMate::Environment
- Inherits:
-
Object
- Object
- ResponseMate::Environment
- Defined in:
- lib/response_mate/environment.rb
Overview
Responsible for parsing the environment file The environment file (by default found as environment.yml in a project) is a Hash which will be used for the rendering of the requests manifest as a [Mustace template](mustache.github.io/mustache.5.html).
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
-
#filename ⇒ Object
Returns the value of attribute filename.
Instance Method Summary collapse
-
#exists? ⇒ TrueClass|FalseClass
Check for environment file existence.
-
#initialize(filename) ⇒ Environment
constructor
A new instance of Environment.
Constructor Details
#initialize(filename) ⇒ Environment
Returns a new instance of Environment.
10 11 12 13 |
# File 'lib/response_mate/environment.rb', line 10 def initialize(filename) @filename = filename || ResponseMate.configuration.environment parse end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
6 7 8 |
# File 'lib/response_mate/environment.rb', line 6 def env @env end |
#filename ⇒ Object
Returns the value of attribute filename.
6 7 8 |
# File 'lib/response_mate/environment.rb', line 6 def filename @filename end |
Instance Method Details
#exists? ⇒ TrueClass|FalseClass
Check for environment file existence
17 18 19 |
# File 'lib/response_mate/environment.rb', line 17 def exists? File.exist? filename end |