module SmoothOperator::Delegation

Public Class Methods

included(base) click to toggle source
# File lib/smooth_operator/delegation.rb, line 20
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/smooth_operator/delegation.rb, line 8
def method_missing(method, *args, &block)
  method_name = method.to_s

  if !! ((method.to_s) =~ /=$/) #setter method
    internal_data_push(method_name[0..-2], args.first)
  elsif !self.class.strict_behaviour || known_attribute?(method_name)
    internal_data_get(method_name)
  else
    super
  end
end
respond_to?(method, include_private = false) click to toggle source
Calls superclass method
# File lib/smooth_operator/delegation.rb, line 4
def respond_to?(method, include_private = false)
  known_attribute?(method) ? true : super
end