Class: WolfTrans::Context::GameDat
- Inherits:
-
WolfTrans::Context
- Object
- WolfTrans::Context
- WolfTrans::Context::GameDat
- Defined in:
- lib/wolftrans/context.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name) ⇒ GameDat
constructor
A new instance of GameDat.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ GameDat
109 110 111 |
# File 'lib/wolftrans/context.rb', line 109 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (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 |
#hash ⇒ Object
117 118 119 |
# File 'lib/wolftrans/context.rb', line 117 def hash @name.hash end |
#to_s ⇒ Object
121 122 123 |
# File 'lib/wolftrans/context.rb', line 121 def to_s "GAMEDAT:#{@name}" end |