Class: RailsBestPractices::Core::Method
- Inherits:
-
Object
- Object
- RailsBestPractices::Core::Method
- Defined in:
- lib/rails_best_practices/core/methods.rb
Overview
Method info includes class name, method name, access control, file, line_number, used.
Instance Attribute Summary collapse
-
#access_control ⇒ Object
readonly
Returns the value of attribute access_control.
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#used ⇒ Object
readonly
Returns the value of attribute used.
Instance Method Summary collapse
-
#initialize(class_name, method_name, access_control, meta) ⇒ Method
constructor
A new instance of Method.
-
#mark_used ⇒ Object
Mark the method as used.
-
#publicize ⇒ Object
Mark the method as public.
Constructor Details
#initialize(class_name, method_name, access_control, meta) ⇒ Method
Returns a new instance of Method.
156 157 158 159 160 161 162 163 |
# File 'lib/rails_best_practices/core/methods.rb', line 156 def initialize(class_name, method_name, access_control, ) @class_name = class_name @method_name = method_name @file = ['file'] @line_number = ['line_number'] @access_control = access_control @used = false end |
Instance Attribute Details
#access_control ⇒ Object (readonly)
Returns the value of attribute access_control.
154 155 156 |
# File 'lib/rails_best_practices/core/methods.rb', line 154 def access_control @access_control end |
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
154 155 156 |
# File 'lib/rails_best_practices/core/methods.rb', line 154 def class_name @class_name end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
154 155 156 |
# File 'lib/rails_best_practices/core/methods.rb', line 154 def file @file end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
154 155 156 |
# File 'lib/rails_best_practices/core/methods.rb', line 154 def line_number @line_number end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
154 155 156 |
# File 'lib/rails_best_practices/core/methods.rb', line 154 def method_name @method_name end |
#used ⇒ Object (readonly)
Returns the value of attribute used.
154 155 156 |
# File 'lib/rails_best_practices/core/methods.rb', line 154 def used @used end |
Instance Method Details
#mark_used ⇒ Object
Mark the method as used.
166 167 168 |
# File 'lib/rails_best_practices/core/methods.rb', line 166 def mark_used @used = true end |
#publicize ⇒ Object
Mark the method as public
171 172 173 |
# File 'lib/rails_best_practices/core/methods.rb', line 171 def publicize @access_control = 'public' end |