Class: Fluent::Json::Schema::Lexicon
- Inherits:
-
Object
- Object
- Fluent::Json::Schema::Lexicon
- Includes:
- Singleton
- Defined in:
- lib/fluent/json/schema/lexicon.rb
Instance Method Summary collapse
Instance Method Details
#combiner ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fluent/json/schema/lexicon.rb', line 20 def combiner named = lambda do |definition, name| definition.new(name) end optioned = lambda do |definition, name, | definition.new(name, ) end lambda do |api, term, definition, args, block| if definition.class.name.demodulize.downcase.to_sym == term return api.add(definition.new(*args)) end results = Fluent::Lexicon.collect( named.curry.(definition), optioned.curry.(definition) ).call(*args) block.call(*results) if block.present? return api.add(*results) end end |
#dictionary ⇒ Object
10 11 12 |
# File 'lib/fluent/json/schema/lexicon.rb', line 10 def dictionary Fluent::Lexicon.reflect(Fluent::Json::Schema::Terms) end |
#translator ⇒ Object
14 15 16 17 18 |
# File 'lib/fluent/json/schema/lexicon.rb', line 14 def translator lambda do |term| term.to_s.singularize.to_sym end end |