Module: Fluent

Extended by:
ActiveSupport::Concern
Defined in:
lib/fluent.rb,
lib/fluent/lexicon.rb,
lib/fluent/version.rb

Defined Under Namespace

Classes: Lexicon

Constant Summary collapse

VERSION =
"0.1.2"

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fluent.rb', line 36

def method_missing(name, *args, &block)
  translated = name
  translated = self.class.translator.call(name) if self.class.translator.present?
  definition = self.class.dictionary.call(translated)
  
  if definition.present?
    result = Flexcon.dispatch({ 
      api: self, 
      name: name, 
      definition: definition, 
      args: args, 
      block: block
    }, self.class.combiner)
    
    return result
  end

  super(name, *args, &block)
end

Instance Method Details

#respond_to?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/fluent.rb', line 32

def respond_to?(name, include_private=false)
  super(name, include_private) || self.class.dictionary.call(name).present?
end