module EacRubyUtils::Listable::InstanceMethods

Constants

LISTABLE_INSTANCE_VALUE_METHODS

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/eac_ruby_utils/listable/instance_methods.rb, line 8
def method_missing(name, *args, &block)
  list, method = parse_method(name)
  list && method ? list.instance_value(self).send(method) : super
end
respond_to_missing?(name, include_all = false) click to toggle source
Calls superclass method
# File lib/eac_ruby_utils/listable/instance_methods.rb, line 13
def respond_to_missing?(name, include_all = false)
  list, method = parse_method(name)
  list && method ? true : super
end

Private Instance Methods

parse_method(method) click to toggle source
# File lib/eac_ruby_utils/listable/instance_methods.rb, line 20
def parse_method(method)
  self.class.lists.acts_as_listable_items.each do |item, list|
    LISTABLE_INSTANCE_VALUE_METHODS.each do |m|
      return [list, m] if method.to_s == "#{item}_#{m}"
    end
  end
  [nil, nil]
end