Class: MVCLI::Action
- Inherits:
-
Object
- Object
- MVCLI::Action
- Defined in:
- lib/mvcli/action.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#mapping ⇒ Object
readonly
Returns the value of attribute mapping.
-
#match ⇒ Object
readonly
Returns the value of attribute match.
Instance Method Summary collapse
- #call(command) ⇒ Object
-
#initialize(match, mapping) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(match, mapping) ⇒ Action
Returns a new instance of Action.
9 10 11 |
# File 'lib/mvcli/action.rb', line 9 def initialize(match, mapping) @match, @mapping = match, mapping end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
7 8 9 |
# File 'lib/mvcli/action.rb', line 7 def endpoint @endpoint end |
#mapping ⇒ Object (readonly)
Returns the value of attribute mapping.
7 8 9 |
# File 'lib/mvcli/action.rb', line 7 def mapping @mapping end |
#match ⇒ Object (readonly)
Returns the value of attribute match.
7 8 9 |
# File 'lib/mvcli/action.rb', line 7 def match @match end |
Instance Method Details
#call(command) ⇒ Object
13 14 15 16 17 |
# File 'lib/mvcli/action.rb', line 13 def call(command) middleware.call(command) do |command| endpoint.call command end end |