Class: SharkOnLambda::RSpec::EnvBuilder
- Inherits:
-
Object
- Object
- SharkOnLambda::RSpec::EnvBuilder
- Defined in:
- lib/shark_on_lambda/rspec/env_builder.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path_parameters ⇒ Object
readonly
Returns the value of attribute path_parameters.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(options = {}) ⇒ EnvBuilder
constructor
A new instance of EnvBuilder.
Constructor Details
#initialize(options = {}) ⇒ EnvBuilder
Returns a new instance of EnvBuilder.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 9 def initialize( = {}) @method = .fetch(:method).to_s.upcase @controller = .fetch(:controller) @action = .fetch(:action) @headers = ([:headers] || {}).deep_stringify_keys @headers.transform_keys!(&:downcase) @params = [:params] || {} @path_parameters = [:path_parameters] || {} initialize_env add_headers add_request_body end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
6 7 8 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 6 def action @action end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 6 def controller @controller end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 6 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 6 def method @method end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
7 8 9 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 7 def params @params end |
#path_parameters ⇒ Object (readonly)
Returns the value of attribute path_parameters.
7 8 9 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 7 def path_parameters @path_parameters end |
Instance Method Details
#build ⇒ Object
24 25 26 |
# File 'lib/shark_on_lambda/rspec/env_builder.rb', line 24 def build env.deep_stringify_keys end |