Class: NumeritajTipo::AttributeDefinition
- Inherits:
-
Object
- Object
- NumeritajTipo::AttributeDefinition
- Defined in:
- lib/numeritaj_tipo/attribute_definition.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #build(target) ⇒ Object
-
#initialize(name, values: nil, type: Symbol, default: nil, allow_nil: false) ⇒ AttributeDefinition
constructor
A new instance of AttributeDefinition.
Constructor Details
#initialize(name, values: nil, type: Symbol, default: nil, allow_nil: false) ⇒ AttributeDefinition
Returns a new instance of AttributeDefinition.
7 8 9 10 11 12 |
# File 'lib/numeritaj_tipo/attribute_definition.rb', line 7 def initialize(name, values: nil, type: Symbol, default: nil, allow_nil: false) @name = name @enum_type = EnumType.new(type, values) @default = default @allow_nil = allow_nil end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
3 4 5 |
# File 'lib/numeritaj_tipo/attribute_definition.rb', line 3 def default @default end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/numeritaj_tipo/attribute_definition.rb', line 3 def name @name end |
Instance Method Details
#build(target) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/numeritaj_tipo/attribute_definition.rb', line 14 def build(target) define_enum! target define_helpers! target define_predicates! target define_scopes! target end |