Class: RuboCop::Rails::SchemaLoader::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/rails/schema_loader/schema.rb

Overview

Represent a column

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Column

Returns a new instance of Column.



120
121
122
123
124
125
126
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 120

def initialize(node)
  @name = node.first_argument.str_content
  @type = node.method_name
  @not_null = nil

  analyze_keywords!(node)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



118
119
120
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 118

def name
  @name
end

#not_nullObject (readonly)

Returns the value of attribute not_null.



118
119
120
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 118

def not_null
  @not_null
end

#typeObject (readonly)

Returns the value of attribute type.



118
119
120
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 118

def type
  @type
end