Class: AnyStyle::Feature::Dictionary
- Inherits:
-
AnyStyle::Feature
- Object
- AnyStyle::Feature
- AnyStyle::Feature::Dictionary
- Defined in:
- lib/anystyle/feature/dictionary.rb
Instance Attribute Summary collapse
-
#dictionary ⇒ Object
readonly
Returns the value of attribute dictionary.
Attributes inherited from AnyStyle::Feature
Instance Method Summary collapse
-
#initialize(dictionary:, **opts) ⇒ Dictionary
constructor
A new instance of Dictionary.
- #observe(token, alpha:, **opts) ⇒ Object
Methods inherited from AnyStyle::Feature
Methods included from StringUtils
canonize, count, display_chars, display_width, indent, nnum, page_break?, scrub, strip_html, transliterate
Constructor Details
#initialize(dictionary:, **opts) ⇒ Dictionary
Returns a new instance of Dictionary.
6 7 8 9 |
# File 'lib/anystyle/feature/dictionary.rb', line 6 def initialize(dictionary:, **opts) super(**opts) @dictionary = dictionary end |
Instance Attribute Details
#dictionary ⇒ Object (readonly)
Returns the value of attribute dictionary.
4 5 6 |
# File 'lib/anystyle/feature/dictionary.rb', line 4 def dictionary @dictionary end |
Instance Method Details
#observe(token, alpha:, **opts) ⇒ Object
11 12 13 |
# File 'lib/anystyle/feature/dictionary.rb', line 11 def observe(token, alpha:, **opts) dictionary.(alpha.downcase) end |