Class: RareMap::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/rare_map/schema_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type) ⇒ Column

Returns a new instance of Column.



86
87
88
89
90
# File 'lib/rare_map/schema_parser.rb', line 86

def initialize(name, type)
  @name = name
  @type = type
  @unique = false
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



83
84
85
# File 'lib/rare_map/schema_parser.rb', line 83

def name
  @name
end

#referencesObject

Returns the value of attribute references.



84
85
86
# File 'lib/rare_map/schema_parser.rb', line 84

def references
  @references
end

#typeObject (readonly)

Returns the value of attribute type.



83
84
85
# File 'lib/rare_map/schema_parser.rb', line 83

def type
  @type
end

#uniqueObject

Returns the value of attribute unique.



84
85
86
# File 'lib/rare_map/schema_parser.rb', line 84

def unique
  @unique
end

Instance Method Details

#foreign_key?Boolean

Returns:

  • (Boolean)


96
97
98
# File 'lib/rare_map/schema_parser.rb', line 96

def foreign_key?
  @references ? true : false
end

#unique?Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/rare_map/schema_parser.rb', line 92

def unique?
  @unique
end