Class: RailsExecution::Services::SyntaxChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_execution/services/syntax_checker.rb

Constant Summary collapse

OK_MESSAGE =
'Syntax OK'

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ SyntaxChecker

Returns a new instance of SyntaxChecker.



6
7
8
# File 'lib/rails_execution/services/syntax_checker.rb', line 6

def initialize(code)
  @code = code
end

Instance Method Details

#callObject



10
11
12
13
14
15
# File 'lib/rails_execution/services/syntax_checker.rb', line 10

def call
  return false if code.blank?

  init_tempfile
  return is_ok?
end