Class: RQueryHook
- Inherits:
-
Mumukit::Templates::FileHook
- Object
- Mumukit::Templates::FileHook
- RQueryHook
- Defined in:
- lib/query_hook.rb
Instance Method Summary collapse
- #command_line(filename) ⇒ Object
- #compile_cookie(cookie) ⇒ Object
- #compile_file_content(r) ⇒ Object
- #compile_file_header(r) ⇒ Object
- #compile_query(query) ⇒ Object
- #tempfile_extension ⇒ Object
Instance Method Details
#command_line(filename) ⇒ Object
33 34 35 |
# File 'lib/query_hook.rb', line 33 def command_line(filename) "Rscript #{filename}" end |
#compile_cookie(cookie) ⇒ Object
27 28 29 30 31 |
# File 'lib/query_hook.rb', line 27 def () return if .blank? compile_statements().join "\n" end |
#compile_file_content(r) ⇒ Object
9 10 11 |
# File 'lib/query_hook.rb', line 9 def compile_file_content(r) "#{compile_file_header(r)}\n#{compile_query(r.query)}" end |
#compile_file_header(r) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/query_hook.rb', line 13 def compile_file_header(r) <<R #{r.extra} #{r.content} #{(r.)} R end |
#compile_query(query) ⇒ Object
23 24 25 |
# File 'lib/query_hook.rb', line 23 def compile_query(query) query end |
#tempfile_extension ⇒ Object
5 6 7 |
# File 'lib/query_hook.rb', line 5 def tempfile_extension '.R' end |