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.



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

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.



114
115
116
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 114

def name
  @name
end

#not_nullObject (readonly)

Returns the value of attribute not_null.



114
115
116
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 114

def not_null
  @not_null
end

#typeObject (readonly)

Returns the value of attribute type.



114
115
116
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 114

def type
  @type
end