Module: Leafy
- Defined in:
- lib/leafy.rb,
lib/leafy/field.rb,
lib/leafy/utils.rb,
lib/leafy/schema.rb,
lib/leafy/version.rb,
lib/leafy/coder/mock.rb,
lib/leafy/field_value.rb,
lib/leafy/mixin/fields.rb,
lib/leafy/mixin/schema.rb,
lib/leafy/coder/default.rb,
lib/leafy/configuration.rb,
lib/leafy/mixin/poro/fields.rb,
lib/leafy/mixin/poro/schema.rb,
lib/leafy/mixin/data_accessor.rb,
lib/leafy/field_value_collection.rb,
lib/leafy/converter/bool_converter.rb,
lib/leafy/converter/date_converter.rb,
lib/leafy/converter/dummy_converter.rb,
lib/leafy/converter/double_converter.rb,
lib/leafy/converter/string_converter.rb,
lib/leafy/mixin/active_record/fields.rb,
lib/leafy/mixin/active_record/schema.rb,
lib/leafy/mixin/active_record/shared.rb,
lib/leafy/converter/integer_converter.rb,
lib/leafy/converter/datetime_converter.rb
Overview
Defined Under Namespace
Modules: Coder, Converter, Mixin, Utils, VERSION
Classes: Configuration, Field, FieldValue, FieldValueCollection, Schema
Class Method Summary
collapse
Class Method Details
20
21
22
|
# File 'lib/leafy.rb', line 20
def self.configure
yield configuration if block_given?
end
|
.converters ⇒ Object
38
39
40
|
# File 'lib/leafy.rb', line 38
def self.converters
@converters ||= {}
end
|
.register_converter(name, converter) ⇒ Object
28
29
30
31
32
33
34
35
36
|
# 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 ⇒ Object
4
5
6
|
# File 'lib/leafy/version.rb', line 4
def self.version
Gem::Version.new VERSION::STRING
end
|