module Leafy

module definition

Public Class Methods

configuration() click to toggle source
# File lib/leafy.rb, line 24
def self.configuration
  @config ||= Leafy::Configuration.new
end
configure() { |configuration| ... } click to toggle source
# File lib/leafy.rb, line 20
def self.configure
  yield configuration if block_given?
end
converters() click to toggle source
# File lib/leafy.rb, line 38
def self.converters
  @converters ||= {}
end
register_converter(name, converter) click to toggle source
# File lib/leafy.rb, line 28
def self.register_converter(name, converter)
  raise(ArgumentError, "converter is not provided") if converter.nil?

  if !converter.respond_to?(:load) || !converter.respond_to?(:dump)
    raise(ArgumentError, "converter must respond to #dump and #load")
  end

  converters[name] = converter
end
version() click to toggle source
# File lib/leafy/version.rb, line 4
def self.version
  Gem::Version.new VERSION::STRING
end