Class: Dusen::Token
- Inherits:
-
Object
- Object
- Dusen::Token
- Defined in:
- lib/dusen/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.
8 9 10 11 12 |
# File 'lib/dusen/token.rb', line 8 def initialize() @value = .fetch(:value) @exclude = .fetch(:exclude) @field = .fetch(:field).to_s end |
Instance Attribute Details
#exclude ⇒ Object (readonly)
Returns the value of attribute exclude.
6 7 8 |
# File 'lib/dusen/token.rb', line 6 def exclude @exclude end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
6 7 8 |
# File 'lib/dusen/token.rb', line 6 def field @field end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/dusen/token.rb', line 6 def value @value end |
Instance Method Details
#exclude? ⇒ Boolean
22 23 24 |
# File 'lib/dusen/token.rb', line 22 def exclude? exclude end |
#text? ⇒ Boolean
18 19 20 |
# File 'lib/dusen/token.rb', line 18 def text? field == 'text' end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/dusen/token.rb', line 14 def to_s value end |