Class: Trifle::Stats::Nocturnal::Parser
- Inherits:
-
Object
- Object
- Trifle::Stats::Nocturnal::Parser
- Defined in:
- lib/trifle/stats/nocturnal/parser.rb
Instance Attribute Summary collapse
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(string) ⇒ Parser
constructor
A new instance of Parser.
- #valid? ⇒ Boolean
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
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
7 8 9 |
# File 'lib/trifle/stats/nocturnal/parser.rb', line 7 def offset @offset end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
7 8 9 |
# File 'lib/trifle/stats/nocturnal/parser.rb', line 7 def string @string end |
#unit ⇒ Object (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
15 16 17 |
# File 'lib/trifle/stats/nocturnal/parser.rb', line 15 def valid? !!(offset && unit) end |