Class: Dinamo::Model::Attributes::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/dinamo/model/attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, **options)
  @name = name
  @type = type
  @required = required
  @primary = primary
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



147
148
149
# File 'lib/dinamo/model/attributes.rb', line 147

def name
  @name
end

#typeObject (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

Returns:

  • (Boolean)


160
161
162
# File 'lib/dinamo/model/attributes.rb', line 160

def primary?
  @primary
end

#required?Boolean

Returns:

  • (Boolean)


156
157
158
# File 'lib/dinamo/model/attributes.rb', line 156

def required?
  @required
end