Class: SEPA::ProfileFeatures

Inherits:
Data
  • Object
show all
Defined in:
lib/sepa_rator/profile.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bic_tagObject (readonly)

Returns the value of attribute bic_tag

Returns:

  • (Object)

    the current value of bic_tag



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def bic_tag
  @bic_tag
end

#charsetObject (readonly)

Returns the value of attribute charset

Returns:

  • (Object)

    the current value of charset



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def charset
  @charset
end

#extrasObject (readonly)

Returns the value of attribute extras

Returns:

  • (Object)

    the current value of extras



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def extras
  @extras
end

#instr_for_cdtr_agt_code_typeObject (readonly)

Returns the value of attribute instr_for_cdtr_agt_code_type

Returns:

  • (Object)

    the current value of instr_for_cdtr_agt_code_type



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def instr_for_cdtr_agt_code_type
  @instr_for_cdtr_agt_code_type
end

#instr_for_dbtr_agt_formatObject (readonly)

Returns the value of attribute instr_for_dbtr_agt_format

Returns:

  • (Object)

    the current value of instr_for_dbtr_agt_format



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def instr_for_dbtr_agt_format
  @instr_for_dbtr_agt_format
end

#min_amountObject (readonly)

Returns the value of attribute min_amount

Returns:

  • (Object)

    the current value of min_amount



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def min_amount
  @min_amount
end

#org_bic_tagObject (readonly)

Returns the value of attribute org_bic_tag

Returns:

  • (Object)

    the current value of org_bic_tag



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def org_bic_tag
  @org_bic_tag
end

#regulatory_reporting_versionObject (readonly)

Returns the value of attribute regulatory_reporting_version

Returns:

  • (Object)

    the current value of regulatory_reporting_version



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def regulatory_reporting_version
  @regulatory_reporting_version
end

#requires_bicObject (readonly)

Returns the value of attribute requires_bic

Returns:

  • (Object)

    the current value of requires_bic



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def requires_bic
  @requires_bic
end

#requires_country_code_on_addressObject (readonly)

Returns the value of attribute requires_country_code_on_address

Returns:

  • (Object)

    the current value of requires_country_code_on_address



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def requires_country_code_on_address
  @requires_country_code_on_address
end

#requires_structured_addressObject (readonly)

Returns the value of attribute requires_structured_address

Returns:

  • (Object)

    the current value of requires_structured_address



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def requires_structured_address
  @requires_structured_address
end

#wrap_dateObject (readonly)

Returns the value of attribute wrap_date

Returns:

  • (Object)

    the current value of wrap_date



4
5
6
# File 'lib/sepa_rator/profile.rb', line 4

def wrap_date
  @wrap_date
end

Class Method Details

.defaultObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/sepa_rator/profile.rb', line 19

def self.default
  new(
    bic_tag: :BICFI,
    wrap_date: true,
    requires_bic: false,
    org_bic_tag: :AnyBIC,
    instr_for_dbtr_agt_format: :text,
    instr_for_cdtr_agt_code_type: :instruction3_code,
    regulatory_reporting_version: :v3,
    charset: :iso_latin,
    min_amount: nil,
    requires_structured_address: false,
    requires_country_code_on_address: false,
    extras: {}.freeze
  )
end

Instance Method Details

#[](key) ⇒ Object

Raises:

  • (KeyError)


36
37
38
39
40
41
# File 'lib/sepa_rator/profile.rb', line 36

def [](key)
  return public_send(key) if respond_to?(key)
  return extras.fetch(key) if extras.key?(key)

  raise KeyError, "Unknown feature key: #{key.inspect}"
end

#merge(**overrides) ⇒ Object



43
44
45
46
47
# File 'lib/sepa_rator/profile.rb', line 43

def merge(**overrides)
  extras_override = overrides.delete(:extras) || {}
  merged_extras = extras.merge(extras_override).freeze
  self.class.new(**to_h, **overrides, extras: merged_extras)
end