Class: PrivatePlease::Tracking::MethodDetails
- Inherits:
-
Struct
- Object
- Struct
- PrivatePlease::Tracking::MethodDetails
- Defined in:
- lib/private_please/tracking/method_details.rb
Constant Summary collapse
- METHOD_AS_KEY_PATTERN =
/(?<klass>.*) (?<separator>[#.]) (?<method>.*) /x
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
-
#method ⇒ Object
Returns the value of attribute method.
-
#separator ⇒ Object
Returns the value of attribute separator.
-
#source_path ⇒ Object
Returns the value of attribute source_path.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass
6 7 8 |
# File 'lib/private_please/tracking/method_details.rb', line 6 def klass @klass end |
#lineno ⇒ Object
Returns the value of attribute lineno
6 7 8 |
# File 'lib/private_please/tracking/method_details.rb', line 6 def lineno @lineno end |
#method ⇒ Object
Returns the value of attribute method
6 7 8 |
# File 'lib/private_please/tracking/method_details.rb', line 6 def method @method end |
#separator ⇒ Object
Returns the value of attribute separator
6 7 8 |
# File 'lib/private_please/tracking/method_details.rb', line 6 def separator @separator end |
#source_path ⇒ Object
Returns the value of attribute source_path
6 7 8 |
# File 'lib/private_please/tracking/method_details.rb', line 6 def source_path @source_path end |
Class Method Details
.from_class_plus_method(class_plus_method) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/private_please/tracking/method_details.rb', line 12 def self.from_class_plus_method(class_plus_method) md = class_plus_method.match(METHOD_AS_KEY_PATTERN) klass = Object.const_get(md[:klass]) separator = md[:separator] method = md[:method].to_sym source_path, lineno = Utils::SourceFileUtils.source_path_and_lineno(klass, separator, method) new(klass, separator, method, source_path, lineno) end |
Instance Method Details
#separator_plus_method ⇒ Object
22 23 24 |
# File 'lib/private_please/tracking/method_details.rb', line 22 def separator_plus_method "#{separator}#{method}" end |