Class: IssuerResponseCodes::Code::Behaviour

Inherits:
Object
  • Object
show all
Defined in:
lib/issuer_response_codes/code/behaviour.rb,
lib/issuer_response_codes/code/behaviour/dsl.rb

Overview

rubocop:disable Style/StaticClass,Style/Documentation

Class Method Summary collapse

Class Method Details

.[](code) ⇒ Object

: (String) -> Symbol



12
13
14
# File 'lib/issuer_response_codes/code/behaviour.rb', line 12

def [](code)
  @map.fetch(code, :retry)
end

.abort_behaviour(codes) ⇒ Object

: (Array) -> void



11
12
13
# File 'lib/issuer_response_codes/code/behaviour/dsl.rb', line 11

def abort_behaviour(codes)
  behaviour(:abort, codes)
end

.behaviour(type, codes) ⇒ Object

: (Symbol, Array) -> void



36
37
38
39
40
# File 'lib/issuer_response_codes/code/behaviour/dsl.rb', line 36

def behaviour(type, codes)
  codes.each do |code|
    @map[code] = type
  end
end

.invalid_amount_behaviour(codes) ⇒ Object

: (Array) -> void



31
32
33
# File 'lib/issuer_response_codes/code/behaviour/dsl.rb', line 31

def invalid_amount_behaviour(codes)
  behaviour(:invalid_amount, codes)
end

.invalid_card_behaviour(codes) ⇒ Object

: (Array) -> void



26
27
28
# File 'lib/issuer_response_codes/code/behaviour/dsl.rb', line 26

def invalid_card_behaviour(codes)
  behaviour(:invalid_card, codes)
end

.retry_later_behaviour(codes) ⇒ Object

: (Array) -> void



16
17
18
# File 'lib/issuer_response_codes/code/behaviour/dsl.rb', line 16

def retry_later_behaviour(codes)
  behaviour(:retry_later, codes)
end

.sca_required_behaviour(codes) ⇒ Object

: (Array) -> void



21
22
23
# File 'lib/issuer_response_codes/code/behaviour/dsl.rb', line 21

def sca_required_behaviour(codes)
  behaviour(:sca_required, codes)
end