Class: Prissy
- Inherits:
-
Object
- Object
- Prissy
- Defined in:
- lib/prissy.rb,
lib/prissy/printer.rb,
lib/prissy/version.rb,
lib/prissy/color_printer.rb
Defined Under Namespace
Classes: ColorPrinter, Printer
Constant Summary collapse
- VERSION =
"1.0.1"
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Prissy
constructor
A new instance of Prissy.
- #prissy(json_or_hash) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Prissy
Returns a new instance of Prissy.
11 12 13 14 15 |
# File 'lib/prissy.rb', line 11 def initialize( = {}) defaults = {} @options = defaults.merge() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/prissy.rb', line 9 def @options end |
Instance Method Details
#prissy(json_or_hash) ⇒ Object
17 18 19 20 21 |
# File 'lib/prissy.rb', line 17 def prissy(json_or_hash) hash = (json_or_hash.is_a?(String) ? parse(json_or_hash) : json_or_hash) printer.print(hash) end |