Module: Sablon::Expression

Defined in:
lib/sablon/operations.rb

Defined Under Namespace

Classes: LookupOrMethodCall, Variable

Class Method Summary collapse

Class Method Details

.parse(expression) ⇒ Object



186
187
188
189
190
191
192
193
# File 'lib/sablon/operations.rb', line 186

def self.parse(expression)
  if expression.include?(".")
    parts = expression.split(".")
    LookupOrMethodCall.new(Variable.new(parts.shift), parts.join("."))
  else
    Variable.new(expression)
  end
end