Class: Salestation::Web::Extractors::InputExtractor

Inherits:
Object
  • Object
show all
Includes:
Deterministic
Defined in:
lib/salestation/web/extractors.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ InputExtractor

Returns a new instance of InputExtractor.



10
11
12
# File 'lib/salestation/web/extractors.rb', line 10

def initialize(&block)
  @block = block
end

Instance Method Details

#call(rack_request) ⇒ Object



14
15
16
# File 'lib/salestation/web/extractors.rb', line 14

def call(rack_request)
  @block.call(rack_request)
end

#coerce(rules) ⇒ Object



22
23
24
# File 'lib/salestation/web/extractors.rb', line 22

def coerce(rules)
  InputCoercer.new(self, rules)
end

#merge(other) ⇒ Object



18
19
20
# File 'lib/salestation/web/extractors.rb', line 18

def merge(other)
  CombinedInputExtractor.new([self, other])
end

#rename(rules) ⇒ Object



26
27
28
# File 'lib/salestation/web/extractors.rb', line 26

def rename(rules)
  InputRenamer.new(self, rules)
end