Class: Sqreen::Js::JsService
- Inherits:
-
Object
- Object
- Sqreen::Js::JsService
- Includes:
- Singleton
- Defined in:
- lib/sqreen/js/js_service.rb
Instance Method Summary collapse
-
#initialize ⇒ JsService
constructor
A new instance of JsService.
- #online? ⇒ Boolean
- #prepare(rule_name, code) ⇒ Sqreen::Js::ExecutableJs
- #variant ⇒ Object
Constructor Details
#initialize ⇒ JsService
Returns a new instance of JsService.
15 16 17 |
# File 'lib/sqreen/js/js_service.rb', line 15 def initialize detect_adapter end |
Instance Method Details
#online? ⇒ Boolean
25 26 27 |
# File 'lib/sqreen/js/js_service.rb', line 25 def online? @online end |
#prepare(rule_name, code) ⇒ Sqreen::Js::ExecutableJs
20 21 22 23 |
# File 'lib/sqreen/js/js_service.rb', line 20 def prepare(rule_name, code) raise 'Not online' unless online? @adapter.preprocess(rule_name, code) end |
#variant ⇒ Object
29 30 31 |
# File 'lib/sqreen/js/js_service.rb', line 29 def variant @adapter.variant_name end |