Class: Document::AttributeInitializer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/document/attribute_initializer/base.rb

Direct Known Subclasses

ActiveModel, Enum

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, name, type, options) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
13
# File 'lib/document/attribute_initializer/base.rb', line 8

def initialize(klass, name, type, options)
  @klass = klass
  @name = name
  @type = type
  @options = options
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



6
7
8
# File 'lib/document/attribute_initializer/base.rb', line 6

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/document/attribute_initializer/base.rb', line 6

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/document/attribute_initializer/base.rb', line 6

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/document/attribute_initializer/base.rb', line 6

def type
  @type
end

Instance Method Details

#call {|name, type, options| ... } ⇒ Object

Yields:



15
16
17
# File 'lib/document/attribute_initializer/base.rb', line 15

def call
  yield name, type, options
end