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.
- #phrase? ⇒ Boolean
- #text? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ Token
Returns a new instance of Token.
6 7 8 9 10 11 |
# File 'lib/minidusen/token.rb', line 6 def initialize() @value = .fetch(:value) @exclude = .fetch(:exclude, false) @field = .fetch(:field).to_s @phrase = .fetch(:phrase, false) 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
21 22 23 |
# File 'lib/minidusen/token.rb', line 21 def exclude? exclude end |
#phrase? ⇒ Boolean
25 26 27 |
# File 'lib/minidusen/token.rb', line 25 def phrase? @phrase end |
#text? ⇒ Boolean
17 18 19 |
# File 'lib/minidusen/token.rb', line 17 def text? field == 'text' end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/minidusen/token.rb', line 13 def to_s value end |