Class: MemoryMonitoring::Injector

Inherits:
Object
  • Object
show all
Defined in:
lib/memory_monitoring/injector.rb

Overview

注入

Instance Method Summary collapse

Constructor Details

#initialize(messages) ⇒ Injector

Returns a new instance of Injector.



6
7
8
# File 'lib/memory_monitoring/injector.rb', line 6

def initialize(messages)
  @messages = messages
end

Instance Method Details

#injection(type, body) ⇒ Object

注入



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/memory_monitoring/injector.rb', line 11

def injection(type, body)
  case type
  when /text\/html/, '*/*'
    html_injection(body)
  when /application\/json/
    json_injection(body)
  when /text\/javascript/
    js_injection(body)
  else
    puts type
    puts '_'*88
    puts body
    puts '_'*88
    body
  end
end