Class: Objectmancy::AttributeOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/objectmancy/attribute_options.rb

Overview

Class to contain the options for attribute definitions. Makes accessing them more Object-Oriented. This could be written with Objectable, but that felt a little too on-the-nose.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ AttributeOptions

Returns a new instance of AttributeOptions.



12
13
14
15
16
# File 'lib/objectmancy/attribute_options.rb', line 12

def initialize(**options)
  @type = options[:type]
  @objectable = options[:objectable]
  @multiple = options[:multiple]
end

Instance Attribute Details

#multipleObject (readonly)

Returns the value of attribute multiple.



10
# File 'lib/objectmancy/attribute_options.rb', line 10

attr_reader :type, :objectable, :multiple

#objectableObject (readonly)



10
# File 'lib/objectmancy/attribute_options.rb', line 10

attr_reader :type, :objectable, :multiple

#typeObject (readonly)



10
11
12
# File 'lib/objectmancy/attribute_options.rb', line 10

def type
  @type
end