Class: Tipi::Configuration::Interpreter
- Inherits:
-
Object
- Object
- Tipi::Configuration::Interpreter
- Defined in:
- lib/tipi/config_dsl.rb
Instance Method Summary collapse
- #error(&block) ⇒ Object
- #gzip_response ⇒ Object
-
#initialize(assembler) ⇒ Interpreter
constructor
make_blank_slate.
- #log(out) ⇒ Object
- #match(pattern, &block) ⇒ Object
Constructor Details
#initialize(assembler) ⇒ Interpreter
make_blank_slate
8 9 10 |
# File 'lib/tipi/config_dsl.rb', line 8 def initialize(assembler) @assembler = assembler end |
Instance Method Details
#error(&block) ⇒ Object
20 21 22 |
# File 'lib/tipi/config_dsl.rb', line 20 def error(&block) assembler.emit_exception_handler &block end |
#gzip_response ⇒ Object
12 13 14 |
# File 'lib/tipi/config_dsl.rb', line 12 def gzip_response @assembler.emit 'req = Tipi::GZip.wrap(req)' end |
#log(out) ⇒ Object
16 17 18 |
# File 'lib/tipi/config_dsl.rb', line 16 def log(out) @assembler.wrap_current_frame 'logger.log_request(req) do |req|' end |
#match(pattern, &block) ⇒ Object
24 25 26 |
# File 'lib/tipi/config_dsl.rb', line 24 def match(pattern, &block) @assembler.emit_conditional "if req.path =~ #{pattern.inspect}", &block end |