Class: Foxtail::Function::Value
- Inherits:
-
Data
- Object
- Data
- Foxtail::Function::Value
- Defined in:
- lib/foxtail/function/value.rb,
lib/foxtail/function/value.rb
Overview
Base class for deferred-formatting values Wraps a value with formatting options, deferring locale-specific formatting until display time
Instance Attribute Summary collapse
-
#options ⇒ Hash
readonly
Formatting options.
-
#value ⇒ Object
readonly
The wrapped raw value.
Instance Method Summary collapse
-
#format ⇒ String
Format the value for display Subclasses may override for locale-specific formatting.
-
#to_s ⇒ String
String representation for interpolation.
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns Formatting options.
14 15 16 |
# File 'lib/foxtail/function/value.rb', line 14 def @options end |
#value ⇒ Object (readonly)
Returns The wrapped raw value.
14 15 16 |
# File 'lib/foxtail/function/value.rb', line 14 def value @value end |
Instance Method Details
#format ⇒ String
Format the value for display Subclasses may override for locale-specific formatting
19 |
# File 'lib/foxtail/function/value.rb', line 19 def format(**) = value.to_s |
#to_s ⇒ String
String representation for interpolation
23 |
# File 'lib/foxtail/function/value.rb', line 23 def to_s = value.to_s |