A module that adds class and instance level options
Defines which options are valid for a given attribute class
@example
class MyTypes < Axiom::Types::Object accept_options :foo, :bar end
@return [self]
@api public
# File lib/axiom/types/support/options.rb, line 21 def accept_options(*new_options) (new_options - accepted_options).each do |new_option| assert_method_available(new_option) define_option_method(new_option) setup_option(new_option) end self end
Set up the option in the current class and descendants
@param [Symbol] new_option
new option to be added
@return [self]
@api private
# File lib/axiom/types/support/options.rb, line 40 def setup_option(new_option) instance_variable_set(:"@#{new_option}", nil) accepted_options << new_option descendants.each do |descendant| descendant.send(__method__, new_option) end self end
Generated with the Darkfish Rdoc Generator 2.