Class: Trifle::Stats::Nocturnal::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/trifle/stats/nocturnal/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Parser

Returns a new instance of Parser.



9
10
11
12
13
# File 'lib/trifle/stats/nocturnal/parser.rb', line 9

def initialize(string)
  @string = string

  parse
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



7
8
9
# File 'lib/trifle/stats/nocturnal/parser.rb', line 7

def offset
  @offset
end

#stringObject (readonly)

Returns the value of attribute string.



7
8
9
# File 'lib/trifle/stats/nocturnal/parser.rb', line 7

def string
  @string
end

#unitObject (readonly)

Returns the value of attribute unit.



7
8
9
# File 'lib/trifle/stats/nocturnal/parser.rb', line 7

def unit
  @unit
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/trifle/stats/nocturnal/parser.rb', line 15

def valid?
  !!(offset && unit)
end