Class: ApiSignature::SpecSupport::PathBuilder
- Inherits:
-
Object
- Object
- ApiSignature::SpecSupport::PathBuilder
- Defined in:
- lib/api_signature/spec_support/path_builder.rb
Constant Summary collapse
- PRIMARY_KEYS =
[:id, :token].freeze
Instance Attribute Summary collapse
-
#action_name ⇒ Object
readonly
Returns the value of attribute action_name.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(controller, action_name, params = {}) ⇒ PathBuilder
constructor
A new instance of PathBuilder.
- #path ⇒ Object
Constructor Details
#initialize(controller, action_name, params = {}) ⇒ PathBuilder
Returns a new instance of PathBuilder.
10 11 12 13 14 |
# File 'lib/api_signature/spec_support/path_builder.rb', line 10 def initialize(controller, action_name, params = {}) @controller = controller @action_name = action_name @params = params end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
6 7 8 |
# File 'lib/api_signature/spec_support/path_builder.rb', line 6 def action_name @action_name end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/api_signature/spec_support/path_builder.rb', line 6 def controller @controller end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/api_signature/spec_support/path_builder.rb', line 6 def params @params end |
Instance Method Details
#path ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/api_signature/spec_support/path_builder.rb', line 16 def path if params[:path].present? hash = params.delete(:path) .merge!(hash) params.merge!(hash) end controller.url_for() end |