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, 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 ⇒ Object
readonly
Returns the value of attribute line.
-
#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.
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, ) @class_name = class_name @method_name = method_name @file = ["file"] @line = ["line"] @access_control = access_control @used = false end |
Instance Attribute Details
#access_control ⇒ Object (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_name ⇒ Object (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 |
#file ⇒ Object (readonly)
Returns the value of attribute file.
146 147 148 |
# File 'lib/rails_best_practices/core/methods.rb', line 146 def file @file end |
#line ⇒ Object (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_name ⇒ Object (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 |
#used ⇒ Object (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_used ⇒ Object
Mark the method as used.
158 159 160 |
# File 'lib/rails_best_practices/core/methods.rb', line 158 def mark_used @used = true end |
#publicize ⇒ Object
Mark the method as public
163 164 165 |
# File 'lib/rails_best_practices/core/methods.rb', line 163 def publicize @access_control = "public" end |