Class: Watobo::Interceptor::Carver

Inherits:
Object
  • Object
show all
Defined in:
lib/watobo/core/intercept_carver.rb

Direct Known Subclasses

RequestCarver, ResponseCarver

Class Method Summary collapse

Class Method Details

.add_rule(rule) ⇒ Object



174
175
176
# File 'lib/watobo/core/intercept_carver.rb', line 174

def self.add_rule(rule)
  @rules << rule if rule.respond_to? :apply
end

.clear_rulesObject



178
179
180
# File 'lib/watobo/core/intercept_carver.rb', line 178

def self.clear_rules
  @rules.clear
end

.rulesObject



157
158
159
# File 'lib/watobo/core/intercept_carver.rb', line 157

def self.rules
  @rules
end

.set_carving_rules(rules) ⇒ Object



170
171
172
# File 'lib/watobo/core/intercept_carver.rb', line 170

def self.set_carving_rules(rules)
  @rules = rules
end

.shape(response, flags) ⇒ Object



161
162
163
164
165
166
167
168
# File 'lib/watobo/core/intercept_carver.rb', line 161

def self.shape(response, flags)
  puts "Shape, Baby shape, ..."

 @rules.each do |r|
   res = r.apply( response, flags )
   puts "#{r.action_name} (#{r.action.class}) >> #{res.class}"
 end
end