Class: RailsBestPractices::Core::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_best_practices/core/methods.rb

Overview

Method info includes class name, method name, access control, file, line, used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(class_name, method_name, access_control, meta) ⇒ Method

Returns a new instance of Method.



148
149
150
151
152
153
154
155
# File 'lib/rails_best_practices/core/methods.rb', line 148

def initialize(class_name, method_name, access_control, meta)
  @class_name = class_name
  @method_name = method_name
  @file = meta["file"]
  @line = meta["line"]
  @access_control = access_control
  @used = false
end

Instance Attribute Details

#access_controlObject (readonly)

Returns the value of attribute access_control.



146
147
148
# File 'lib/rails_best_practices/core/methods.rb', line 146

def access_control
  @access_control
end

#class_nameObject (readonly)

Returns the value of attribute class_name.



146
147
148
# File 'lib/rails_best_practices/core/methods.rb', line 146

def class_name
  @class_name
end

#fileObject (readonly)

Returns the value of attribute file.



146
147
148
# File 'lib/rails_best_practices/core/methods.rb', line 146

def file
  @file
end

#lineObject (readonly)

Returns the value of attribute line.



146
147
148
# File 'lib/rails_best_practices/core/methods.rb', line 146

def line
  @line
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



146
147
148
# File 'lib/rails_best_practices/core/methods.rb', line 146

def method_name
  @method_name
end

#usedObject (readonly)

Returns the value of attribute used.



146
147
148
# File 'lib/rails_best_practices/core/methods.rb', line 146

def used
  @used
end

Instance Method Details

#mark_usedObject

Mark the method as used.



158
159
160
# File 'lib/rails_best_practices/core/methods.rb', line 158

def mark_used
  @used = true
end

#publicizeObject

Mark the method as public



163
164
165
# File 'lib/rails_best_practices/core/methods.rb', line 163

def publicize
  @access_control = "public"
end