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.



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

def initialize(&block)
  @block = block
end

Instance Method Details

#call(rack_request) ⇒ Object



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

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

#coerce(rules) ⇒ Object



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

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

#merge(other) ⇒ Object



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

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

#rename(rules) ⇒ Object



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

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