Module: ActsAsInterface::ClassMethods

Defined in:
lib/acts_as_interface.rb

Instance Method Summary collapse

Instance Method Details

#abstract_methods(*args) ⇒ Object



65
66
67
68
69
70
71
72
73
74
# File 'lib/acts_as_interface.rb', line 65

def abstract_methods(*args)
  options = args.extract_options!
  args.each do |abstract_method_name|
    if options[:for] == :class
      (class << self; self; end).define_abstract_method(abstract_method_name, options)
    else
      define_abstract_method(abstract_method_name, options)
    end        
  end
end

#callbacks(*args) ⇒ Object



76
77
78
79
80
# File 'lib/acts_as_interface.rb', line 76

def callbacks(*args)
  options = args.extract_options!
  options = {:default => nil}.merge(options)
  abstract_methods(*args.push(options))
end