class Ettin::MethodName
A class for analyzing and manipulating a method's name
Constants
- ASSIGN_CHAR
- BANG_CHAR
Attributes
method[R]
Public Class Methods
new(method)
click to toggle source
# File lib/ettin/method_name.rb, line 10 def initialize(method) @method = method.to_s end
Public Instance Methods
assignment?()
click to toggle source
# File lib/ettin/method_name.rb, line 34 def assignment? method[-1] == ASSIGN_CHAR end
bang?()
click to toggle source
# File lib/ettin/method_name.rb, line 30 def bang? method[-1] == BANG_CHAR end
clean()
click to toggle source
# File lib/ettin/method_name.rb, line 22 def clean @clean ||= if bang? || assignment? method.chop else method end.to_sym end
to_s()
click to toggle source
# File lib/ettin/method_name.rb, line 18 def to_s method end
to_sym()
click to toggle source
# File lib/ettin/method_name.rb, line 14 def to_sym method.to_sym end