Class: Carpenter::Model::FieldDefinition
- Inherits:
-
Object
- Object
- Carpenter::Model::FieldDefinition
- Defined in:
- lib/carpenter/model/field_definition.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #create_instance(key) ⇒ Object
- #dup ⇒ Object
-
#initialize(name, type, **options) ⇒ FieldDefinition
constructor
A new instance of FieldDefinition.
- #inspect ⇒ Object
- #to_s ⇒ Object
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, **) @name = name @type = type @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/carpenter/model/field_definition.rb', line 4 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/carpenter/model/field_definition.rb', line 4 def @options end |
#type ⇒ Object (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) |
#dup ⇒ Object
12 |
# File 'lib/carpenter/model/field_definition.rb', line 12 def dup = self.class.new(name, type, **) |
#inspect ⇒ Object
14 |
# File 'lib/carpenter/model/field_definition.rb', line 14 def inspect = @name.inspect |
#to_s ⇒ Object
13 |
# File 'lib/carpenter/model/field_definition.rb', line 13 def to_s = @name.to_s |