Module: Axiom::Types::Options

Included in:
Infinity, Type
Defined in:
lib/axiom/types/support/options.rb

Overview

A module that adds class and instance level options

Defined Under Namespace

Classes: ReservedMethodError

Instance Method Summary collapse

Instance Method Details

#accept_options(*new_options) ⇒ self

Defines which options are valid for a given attribute class

Examples:

class MyTypes < Axiom::Types::Object
  accept_options :foo, :bar
end

Returns:

  • (self)


22
23
24
25
26
27
28
29
# File 'lib/axiom/types/support/options.rb', line 22

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