Class: MVCLI::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/mvcli/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#endpointObject (readonly)

Returns the value of attribute endpoint.



7
8
9
# File 'lib/mvcli/action.rb', line 7

def endpoint
  @endpoint
end

#mappingObject (readonly)

Returns the value of attribute mapping.



7
8
9
# File 'lib/mvcli/action.rb', line 7

def mapping
  @mapping
end

#matchObject (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