Class: StringEater::Token
- Inherits:
-
Object
- Object
- StringEater::Token
- Defined in:
- lib/token.rb
Instance Attribute Summary collapse
-
#breakpoints ⇒ Object
Returns the value of attribute breakpoints.
-
#children ⇒ Object
Returns the value of attribute children.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#string ⇒ Object
Returns the value of attribute string.
Class Method Summary collapse
Instance Method Summary collapse
- #extract? ⇒ Boolean
-
#initialize ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize ⇒ Token
Returns a new instance of Token.
4 5 6 7 |
# File 'lib/token.rb', line 4 def initialize @opts = {} @breakpoints = [nil,nil] end |
Instance Attribute Details
#breakpoints ⇒ Object
Returns the value of attribute breakpoints.
2 3 4 |
# File 'lib/token.rb', line 2 def breakpoints @breakpoints end |
#children ⇒ Object
Returns the value of attribute children.
2 3 4 |
# File 'lib/token.rb', line 2 def children @children end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/token.rb', line 2 def name @name end |
#opts ⇒ Object
Returns the value of attribute opts.
2 3 4 |
# File 'lib/token.rb', line 2 def opts @opts end |
#string ⇒ Object
Returns the value of attribute string.
2 3 4 |
# File 'lib/token.rb', line 2 def string @string end |
Class Method Details
.new_field(name, opts) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/token.rb', line 13 def self.new_field(name, opts) t = new t.name = name t.opts = {:extract => true}.merge(opts) t end |
.new_separator(string) ⇒ Object
20 21 22 23 24 |
# File 'lib/token.rb', line 20 def self.new_separator(string) t = new t.string = string t end |
Instance Method Details
#extract? ⇒ Boolean
9 10 11 |
# File 'lib/token.rb', line 9 def extract? @opts[:extract] end |