Class: Motoko::Formatters::BaseFormatter
- Inherits:
-
Object
- Object
- Motoko::Formatters::BaseFormatter
- Defined in:
- lib/motoko/formatters/base_formatter.rb
Direct Known Subclasses
Boolean, Datetime, DatetimeAgo, Ellipsis, Timestamp, TimestampAgo
Instance Method Summary collapse
- #format(value) ⇒ Object
-
#initialize(options = {}) ⇒ BaseFormatter
constructor
A new instance of BaseFormatter.
Constructor Details
#initialize(options = {}) ⇒ BaseFormatter
Returns a new instance of BaseFormatter.
6 |
# File 'lib/motoko/formatters/base_formatter.rb', line 6 def initialize( = {}) end |
Instance Method Details
#format(value) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/motoko/formatters/base_formatter.rb', line 8 def format(value) case value when Array value.join("\n") when Hash value.keys.join("\n") else value.to_s end end |