Class: Rich::I18n::Core::EnrichedString
- Defined in:
- lib/rich/i18n/core/enriched_string.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #enriched_string? ⇒ Boolean
-
#initialize(string = "", meta_data = nil) ⇒ EnrichedString
constructor
A new instance of EnrichedString.
- #to_es ⇒ Object (also: #to_s)
Constructor Details
#initialize(string = "", meta_data = nil) ⇒ EnrichedString
Returns a new instance of EnrichedString.
11 12 13 14 |
# File 'lib/rich/i18n/core/enriched_string.rb', line 11 def initialize(string = "", = nil) @string = string @meta_data = || (s..dup unless (string..nil? rescue true)) || {} end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
9 10 11 |
# File 'lib/rich/i18n/core/enriched_string.rb', line 9 def string @string end |
Instance Method Details
#enriched_string? ⇒ Boolean
16 17 18 |
# File 'lib/rich/i18n/core/enriched_string.rb', line 16 def enriched_string? true end |
#to_es ⇒ Object Also known as: to_s
20 21 22 |
# File 'lib/rich/i18n/core/enriched_string.rb', line 20 def to_es (@meta_data.filled? && Engine.can_enrich_output?) ? to_tag : @string end |