Module: AttrOptional

Defined in:
lib/attr_optional.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


3
4
5
# File 'lib/attr_optional.rb', line 3

def self.included(klass)
  klass.send :extend, ClassMethods
end

Instance Method Details

#attr_optional?(key) ⇒ Boolean

Returns:

  • (Boolean)

47
48
49
# File 'lib/attr_optional.rb', line 47

def attr_optional?(key)
  self.class.attr_optional? key
end

#optional_attributesObject


43
44
45
# File 'lib/attr_optional.rb', line 43

def optional_attributes
  self.class.optional_attributes
end