Exception: Simple::Service::NoSuchAction

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/simple/service/errors.rb

Overview

Will be raised by ::Simple::Service.action.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, name) ⇒ NoSuchAction

Returns a new instance of NoSuchAction



5
6
7
# File 'lib/simple/service/errors.rb', line 5

def initialize(service, name)
  @service, @name = service, name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name



4
5
6
# File 'lib/simple/service/errors.rb', line 4

def name
  @name
end

#serviceObject (readonly)

Returns the value of attribute service



4
5
6
# File 'lib/simple/service/errors.rb', line 4

def service
  @service
end

Instance Method Details

#to_sObject



9
10
11
12
13
# File 'lib/simple/service/errors.rb', line 9

def to_s
  action_names = ::Simple::Service.actions(service).keys.sort
  informal = "service #{service} has these actions: #{action_names.map(&:inspect).join(", ")}"
  "No such action #{name.inspect}; #{informal}"
end