Class: RailsTwirp::ServiceMapper::Mapping
- Inherits:
-
Object
- Object
- RailsTwirp::ServiceMapper::Mapping
- Defined in:
- lib/rails_twirp/mapper.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
-
#initialize(to:, **options) ⇒ Mapping
constructor
A new instance of Mapping.
- #to_s ⇒ Object
Constructor Details
#initialize(to:, **options) ⇒ Mapping
Returns a new instance of Mapping.
10 11 12 13 14 |
# File 'lib/rails_twirp/mapper.rb', line 10 def initialize(to:, **) controller, @action = split_to(to) @controller = add_controller_module(controller, .delete(:module)) raise ArgumentError, "Unknown argument #{.keys.first}" unless .empty? end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'lib/rails_twirp/mapper.rb', line 8 def action @action end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
8 9 10 |
# File 'lib/rails_twirp/mapper.rb', line 8 def controller @controller end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/rails_twirp/mapper.rb', line 16 def to_s "#{controller}##{action}" end |