Class: Irc::Bot::MessageMapper::Failure

Inherits:
Object
  • Object
show all
Defined in:
/home/apoc/projects/ruby/rbot/lib/rbot/messagemapper.rb

Direct Known Subclasses

FriendlyFailure, NoMatchFailure, PartialMatchFailure

Constant Summary

STRING =
"template %{template} failed to recognize message %{message}"
FRIENDLY =
"I failed to understand the command"

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Failure) initialize(tmpl, msg)

Returns a new instance of Failure



61
62
63
64
# File '/home/apoc/projects/ruby/rbot/lib/rbot/messagemapper.rb', line 61

def initialize(tmpl, msg)
  @template = tmpl
  @message = msg
end

Instance Attribute Details

- (Object) message (readonly)

Returns the value of attribute message



60
61
62
# File '/home/apoc/projects/ruby/rbot/lib/rbot/messagemapper.rb', line 60

def message
  @message
end

- (Object) template (readonly)

Returns the value of attribute template



59
60
61
# File '/home/apoc/projects/ruby/rbot/lib/rbot/messagemapper.rb', line 59

def template
  @template
end

Instance Method Details

- (Object) to_s



66
67
68
69
70
71
72
73
# File '/home/apoc/projects/ruby/rbot/lib/rbot/messagemapper.rb', line 66

def to_s
  STRING % {
    :template => template.template,
    :regexp => template.regexp,
    :message => message.message,
    :action => template.options[:action]
  }
end