Class: CodeigniterScaffold::Attribute

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argument) ⇒ Attribute

Returns a new instance of Attribute.



6
7
8
9
10
11
# File 'lib/codeigniter_scaffold/attribute.rb', line 6

def initialize(argument)
  @name = argument.split(":")[0].downcase
  @type = argument.split(":")[1].downcase
  @mysql_type = find_mysql_type
  validate
end

Instance Attribute Details

#mysql_typeObject

Returns the value of attribute mysql_type.



4
5
6
# File 'lib/codeigniter_scaffold/attribute.rb', line 4

def mysql_type
  @mysql_type
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/codeigniter_scaffold/attribute.rb', line 4

def name
  @name
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/codeigniter_scaffold/attribute.rb', line 4

def type
  @type
end