Class: Carpenter::Model::FieldDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/carpenter/model/field_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, **options) ⇒ FieldDefinition

Returns a new instance of FieldDefinition.



6
7
8
9
10
# File 'lib/carpenter/model/field_definition.rb', line 6

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/carpenter/model/field_definition.rb', line 4

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/carpenter/model/field_definition.rb', line 4

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/carpenter/model/field_definition.rb', line 4

def type
  @type
end

Instance Method Details

#create_instance(key) ⇒ Object



16
# File 'lib/carpenter/model/field_definition.rb', line 16

def create_instance(key) = Carpenter::Model::Field.new(self, key)

#dupObject



12
# File 'lib/carpenter/model/field_definition.rb', line 12

def dup = self.class.new(name, type, **options)

#inspectObject



14
# File 'lib/carpenter/model/field_definition.rb', line 14

def inspect = @name.inspect

#to_sObject



13
# File 'lib/carpenter/model/field_definition.rb', line 13

def to_s = @name.to_s