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

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



162
163
164
# File 'lib/dinamo/model/attributes.rb', line 162

def default
  @default
end

#nameObject (readonly)

Returns the value of attribute name.



162
163
164
# File 'lib/dinamo/model/attributes.rb', line 162

def name
  @name
end

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

Returns:

  • (Boolean)


176
177
178
# File 'lib/dinamo/model/attributes.rb', line 176

def primary?
  @primary
end

#required?Boolean

Returns:

  • (Boolean)


172
173
174
# File 'lib/dinamo/model/attributes.rb', line 172

def required?
  @required
end