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.



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

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.



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

def name
  @name
end

#not_nullObject (readonly)

Returns the value of attribute not_null.



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

def not_null
  @not_null
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end