class Kumogata2::Plugin::YAML

Public Class Methods

new(options) click to toggle source
# File lib/kumogata2/plugin/yaml.rb, line 6
def initialize(options)
  @options = options
end

Public Instance Methods

dump(hash, color = true) click to toggle source
# File lib/kumogata2/plugin/yaml.rb, line 14
def dump(hash, color = true)
  Hashie.stringify_keys!(hash)
  if color
    YAML.dump(hash).colorize_as(:yaml)
  else
    YAML.dump(hash)
  end
end
parse(str) click to toggle source
# File lib/kumogata2/plugin/yaml.rb, line 10
def parse(str)
  YAML.load(str)
end