Module: SeedFormatter
- Defined in:
- lib/seed_formatter.rb,
lib/seed_formatter/version.rb
Constant Summary collapse
- VERSION =
"1.1.0"
Instance Method Summary collapse
-
#error(message, options = {}) ⇒ Object
A preset formatter with overridable options.
-
#message(message, options = {}) ⇒ Object
A preset formatter with overridable options.
-
#output(message, options = {}) ⇒ Object
Outputs a message with a set of given options.
- #spacer ⇒ Object
-
#success(message, options = {}) ⇒ Object
A preset formatter with overridable options.
Instance Method Details
#error(message, options = {}) ⇒ Object
A preset formatter with overridable options
37 38 39 40 41 |
# File 'lib/seed_formatter.rb', line 37 def error(, = {}) [:prefix] ||= " - " [:color] ||= :red output , end |
#message(message, options = {}) ⇒ Object
A preset formatter with overridable options
23 24 25 26 27 |
# File 'lib/seed_formatter.rb', line 23 def (, = {}) [:prefix] ||= "*** " [:color] ||= :white output , end |
#output(message, options = {}) ⇒ Object
Outputs a message with a set of given options
17 18 19 20 |
# File 'lib/seed_formatter.rb', line 17 def output(, = {}) [:color] ||= :white $stdout.puts "#{[:prefix]}#{}#{[:suffix]}".send([:color]) end |
#spacer ⇒ Object
43 44 45 |
# File 'lib/seed_formatter.rb', line 43 def spacer $stdout.puts "" end |
#success(message, options = {}) ⇒ Object
A preset formatter with overridable options
30 31 32 33 34 |
# File 'lib/seed_formatter.rb', line 30 def success(, = {}) [:prefix] ||= " + " [:color] ||= :green output , end |