Class: WolfTrans::Context::GameDat

Inherits:
WolfTrans::Context show all
Defined in:
lib/wolftrans/context.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ GameDat



109
110
111
# File 'lib/wolftrans/context.rb', line 109

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



107
108
109
# File 'lib/wolftrans/context.rb', line 107

def name
  @name
end

Class Method Details

.from_data(name) ⇒ Object



125
126
127
# File 'lib/wolftrans/context.rb', line 125

def self.from_data(name)
  GameDat.new(name)
end

.from_string(path) ⇒ Object



129
130
131
132
133
134
# File 'lib/wolftrans/context.rb', line 129

def self.from_string(path)
  if path.size != 1
    raise "invalid path specified for GAMEDAT context line"
  end
  GameDat.new(path.first)
end

Instance Method Details

#eql?(other) ⇒ Boolean



113
114
115
# File 'lib/wolftrans/context.rb', line 113

def eql?(other)
  super && @name == other.name
end

#hashObject



117
118
119
# File 'lib/wolftrans/context.rb', line 117

def hash
  @name.hash
end

#to_sObject



121
122
123
# File 'lib/wolftrans/context.rb', line 121

def to_s
  "GAMEDAT:#{@name}"
end