Class: Pakyow::Data::UnknownSource

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

Instance Method Summary collapse

Instance Method Details

#contextual_messageObject



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/pakyow/data/errors.rb', line 136

def contextual_message
  if sources.any?
    String.new(
      <<~MESSAGE
        The following sources are defined:
      MESSAGE
    ).tap do |message|
      sources.keys.each do |source|
        message << "  * #{source}\n"
      end
    end
  else
    String.new(
      <<~MESSAGE
        No sources are defined.
      MESSAGE
    )
  end
end