Class: Creamerscript::Sweeteners::PropertyInvocation
- Inherits:
-
Base
- Object
- Base
- Creamerscript::Sweeteners::PropertyInvocation
show all
- Defined in:
- lib/creamerscript/sweeteners/property_invocation.rb
Constant Summary
Constants inherited
from Base
Base::SYMBOL
Instance Attribute Summary
Attributes inherited from Base
#source, #substitutions
Instance Method Summary
collapse
Methods inherited from Base
#call, #initialize, #substitute, #token, #tokenize, #type
Instance Method Details
4
5
6
|
# File 'lib/creamerscript/sweeteners/property_invocation.rb', line 4
def pattern
/\(#{SYMBOL} #{SYMBOL}\)/
end
|
#property_name ⇒ Object
16
17
18
|
# File 'lib/creamerscript/sweeteners/property_invocation.rb', line 16
def property_name
body.split.last
end
|
12
13
14
|
# File 'lib/creamerscript/sweeteners/property_invocation.rb', line 12
def subject
body.split.first
end
|
#to_coffee ⇒ Object
8
9
10
|
# File 'lib/creamerscript/sweeteners/property_invocation.rb', line 8
def to_coffee
"#{subject}.#{property_name}"
end
|