Class: Minidusen::Token
- Inherits:
-
Object
- Object
- Minidusen::Token
- Defined in:
- lib/minidusen/token.rb
Instance Attribute Summary collapse
-
#exclude ⇒ Object
readonly
Returns the value of attribute exclude.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #exclude? ⇒ Boolean
-
#initialize(options) ⇒ Token
constructor
A new instance of Token.
- #text? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ Token
Returns a new instance of Token.
6 7 8 9 10 |
# File 'lib/minidusen/token.rb', line 6 def initialize() @value = .fetch(:value) @exclude = .fetch(:exclude, false) @field = .fetch(:field).to_s end |
Instance Attribute Details
#exclude ⇒ Object (readonly)
Returns the value of attribute exclude.
4 5 6 |
# File 'lib/minidusen/token.rb', line 4 def exclude @exclude end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
4 5 6 |
# File 'lib/minidusen/token.rb', line 4 def field @field end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/minidusen/token.rb', line 4 def value @value end |
Instance Method Details
#exclude? ⇒ Boolean
20 21 22 |
# File 'lib/minidusen/token.rb', line 20 def exclude? exclude end |
#text? ⇒ Boolean
16 17 18 |
# File 'lib/minidusen/token.rb', line 16 def text? field == 'text' end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/minidusen/token.rb', line 12 def to_s value end |