class WolfTrans::Context::CommonEvent

Attributes

command_name[R]
event_num[R]
line_num[R]

Public Class Methods

from_data(event, cmd_index, command) click to toggle source
# File lib/wolftrans/context.rb, line 96
def self.from_data(event, cmd_index, command)
  CommonEvent.new(event.id, cmd_index + 1, command.class.name.split('::').last)
end
from_string(path) click to toggle source
# File lib/wolftrans/context.rb, line 100
def self.from_string(path)
  event_num, line_num, command_name = path
  CommonEvent.new(event_num.to_i, line_num.to_i, command_name)
end
new(event_num, line_num, command_name) click to toggle source
# File lib/wolftrans/context.rb, line 78
def initialize(event_num, line_num, command_name)
  @event_num = event_num
  @line_num = line_num
  @command_name = command_name
end

Public Instance Methods

eql?(other) click to toggle source
Calls superclass method WolfTrans::Context#eql?
# File lib/wolftrans/context.rb, line 84
def eql?(other)
  super && @event_num == other.event_num
end
hash() click to toggle source
# File lib/wolftrans/context.rb, line 88
def hash
  @event_num.hash
end
to_s() click to toggle source
# File lib/wolftrans/context.rb, line 92
def to_s
  "COMMONEVENT:#{@event_num}/#{@line_num}/#{@command_name}"
end