Class: Pakyow::Data::UnknownCommand

Inherits:
Error
  • Object
show all
Defined in:
lib/pakyow/data/errors.rb

Instance Method Summary collapse

Instance Method Details

#contextual_messageObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/pakyow/data/errors.rb', line 104

def contextual_message
  if commands.any?
    String.new(
      "        The following commands are defined for \#{@context.__object_name.name}:\n      MESSAGE\n    ).tap do |message|\n      commands.keys.each do |command|\n        message << \"  * \#{command}\\n\"\n      end\n    end\n  else\n    String.new(\n      <<~MESSAGE\n        No commands are defined for \#{@context.__object_name.name}.\n      MESSAGE\n    )\n  end\nend\n"