Class: Temple::StaticAnalyzer::ShorthandSyntaxChecker

Inherits:
Ripper
  • Object
show all
Defined in:
lib/temple/static_analyzer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShorthandSyntaxChecker

Returns a new instance of ShorthandSyntaxChecker.



128
129
130
131
# File 'lib/temple/static_analyzer.rb', line 128

def initialize(*)
  super
  @shorthand = nil
end

Instance Attribute Details

#shorthandObject (readonly)

Returns the value of attribute shorthand.



126
127
128
# File 'lib/temple/static_analyzer.rb', line 126

def shorthand
  @shorthand
end

Class Method Details

.shorthand?(code) ⇒ Boolean

Returns:

  • (Boolean)


119
120
121
122
123
# File 'lib/temple/static_analyzer.rb', line 119

def shorthand?(code)
  instance = new(code)
  instance.parse
  instance.shorthand
end