Class: Croods::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/croods/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, null: nil, default: nil, default_function: nil) ⇒ Attribute

Returns a new instance of Attribute.



7
8
9
10
11
12
13
# File 'lib/croods/attribute.rb', line 7

def initialize(name, type, null: nil, default: nil, default_function: nil)
  self.name = name.to_s
  self.type = type
  self.null = null
  self.default = default
  self.default_function = default_function
end

Instance Attribute Details

#defaultObject

Returns the value of attribute default.



5
6
7
# File 'lib/croods/attribute.rb', line 5

def default
  @default
end

#default_functionObject

Returns the value of attribute default_function.



5
6
7
# File 'lib/croods/attribute.rb', line 5

def default_function
  @default_function
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/croods/attribute.rb', line 5

def name
  @name
end

#nullObject

Returns the value of attribute null.



5
6
7
# File 'lib/croods/attribute.rb', line 5

def null
  @null
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/croods/attribute.rb', line 5

def type
  @type
end