Class: Dinamo::Model::Attributes::Key
- Inherits:
-
Object
- Object
- Dinamo::Model::Attributes::Key
- Defined in:
- lib/dinamo/model/attributes.rb
Instance Attribute Summary collapse
-
#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, **options) ⇒ Key
constructor
A new instance of Key.
- #primary? ⇒ Boolean
- #required? ⇒ Boolean
Constructor Details
#initialize(name, type: nil, required: false, primary: false, **options) ⇒ Key
Returns a new instance of Key.
149 150 151 152 153 154 |
# File 'lib/dinamo/model/attributes.rb', line 149 def initialize(name, type: nil, required: false, primary: false, **) @name = name @type = type @required = required @primary = primary end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
147 148 149 |
# File 'lib/dinamo/model/attributes.rb', line 147 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
147 148 149 |
# File 'lib/dinamo/model/attributes.rb', line 147 def type @type end |
Instance Method Details
#primary? ⇒ Boolean
160 161 162 |
# File 'lib/dinamo/model/attributes.rb', line 160 def primary? @primary end |
#required? ⇒ Boolean
156 157 158 |
# File 'lib/dinamo/model/attributes.rb', line 156 def required? @required end |