Sha256: 8379b5486abc5c5af4c9fc426c90a23890710e76c379d947eb13e0143f4fd29a
Contents?: true
Size: 1019 Bytes
Versions: 24
Compression:
Stored size: 1019 Bytes
Contents
module Intercom module Traits # Allows us to have one class level method missing handler across all entities # which can dispatch to the appropriate function based on the method name module GenericHandlerBinding module ClassMethods def method_missing(method_sym, *arguments, &block) if respond_to? :generic_tag and GenericHandlers::Tag.handles_method?(method_sym) return generic_tag(method_sym, *arguments, block) elsif respond_to? :generic_tag_find_all and GenericHandlers::TagFindAll.handles_method?(method_sym) return generic_tag_find_all(method_sym, *arguments, block) elsif respond_to? :generic_count and GenericHandlers::Count.handles_method?(method_sym) return generic_count(method_sym, *arguments, block) end super rescue Intercom::NoMethodMissingHandler super end end def self.included(base) base.extend(ClassMethods) end end end end
Version data entries
24 entries across 24 versions & 2 rubygems