Class: Dinamo::Model::Attributes::Key
- Inherits:
-
Object
- Object
- Dinamo::Model::Attributes::Key
- Defined in:
- lib/dinamo/model/attributes.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type: nil, required: false, primary: false, default: nil, **options) ⇒ Key
constructor
A new instance of Key.
- #primary? ⇒ Boolean
- #required? ⇒ Boolean
Constructor Details
#initialize(name, type: nil, required: false, primary: false, default: nil, **options) ⇒ Key
Returns a new instance of Key.
164 165 166 167 168 169 170 |
# File 'lib/dinamo/model/attributes.rb', line 164 def initialize(name, type: nil, required: false, primary: false, default: nil, **) @name = name @type = type @required = required @primary = primary @default = default end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
162 163 164 |
# File 'lib/dinamo/model/attributes.rb', line 162 def default @default end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
162 163 164 |
# File 'lib/dinamo/model/attributes.rb', line 162 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
162 163 164 |
# File 'lib/dinamo/model/attributes.rb', line 162 def type @type end |
Instance Method Details
#primary? ⇒ Boolean
176 177 178 |
# File 'lib/dinamo/model/attributes.rb', line 176 def primary? @primary end |
#required? ⇒ Boolean
172 173 174 |
# File 'lib/dinamo/model/attributes.rb', line 172 def required? @required end |