module UOBBranchCodes
  def branch_code
    reference_hash.fetch(:branch_code)
  end

  def branch_name
    reference_hash.fetch(:branch_name)
  end

  private
  def reference_hash
    reference_hash_collection.fetch(retrieval_code)
  end

  def retrieval_code
    result = number.to_s[0..2].to_i
    if result == 301
      result = number.to_s[0..3].to_i
    end
    result
  end

  def reference_hash_collection
    {
      101 => {branch_code: '001', branch_name: "UOB Main" },
      102 => {branch_code: '002', branch_name: "UOB Jalan Sultan" },
      103 => {branch_code: '003', branch_name: "UOB City Plaza" },
      104 => {branch_code: '004', branch_name: "UOB Tai Seng" },
      105 => {branch_code: '005', branch_name: "UOB Rochor" },
      106 => {branch_code: '006', branch_name: "UOB Novena Square " },
      107 => {branch_code: '007', branch_name: "UOB Thomson" },
      108 => {branch_code: '008', branch_name: "UOB Vivo City" },
      109 => {branch_code: '009', branch_name: "UOB Tanjong Pagar " },
      110 => {branch_code: '010', branch_name: "UOB Thomson" },
      111 => {branch_code: '011', branch_name: "UOB Tanjong Pagar " },
      112 => {branch_code: '012', branch_name: "UOB Bukit Panjang " },
      113 => {branch_code: '013', branch_name: "UOB Jurong Point" },
      114 => {branch_code: '014', branch_name: "UOB City Plaza" },
      115 => {branch_code: '015', branch_name: "UOB Toa Payoh" },
      116 => {branch_code: '016', branch_name: "UOB Novena Square " },
      117 => {branch_code: '017', branch_name: "UOB Coleman" },
      118 => {branch_code: '018', branch_name: "UOB Scotts" },
      119 => {branch_code: '019', branch_name: "UOB New Bridge" },
      120 => {branch_code: '020', branch_name: "UOB Holland" },
      121 => {branch_code: '021', branch_name: "UOB Tanjong Pagar " },
      122 => {branch_code: '022', branch_name: "UOB Thomson" },
      123 => {branch_code: '023', branch_name: "UOB Serangoon Garden " },
      124 => {branch_code: '024', branch_name: "UOB Serangoon Garden " },
      125 => {branch_code: '025', branch_name: "UOB Katong" },
      126 => {branch_code: '026', branch_name: "UOB Bukit Timah" },
      127 => {branch_code: '027', branch_name: "UOB Bedok" },
      128 => {branch_code: '028', branch_name: "UOB Ang Mo Kio" },
      129 => {branch_code: '029', branch_name: "UOB Scotts Square " },
      130 => {branch_code: '030', branch_name: "UOB Clementi" },
      131 => {branch_code: '031', branch_name: "UOB Katong" },
      132 => {branch_code: '032', branch_name: "UOB Aljunied" },
      133 => {branch_code: '033', branch_name: "UOB Novena Square " },
      134 => {branch_code: '034', branch_name: "UOB Clementi" },
      135 => {branch_code: '035', branch_name: "UOB Boon Lay" },
      136 => {branch_code: '036', branch_name: "UOB Parkway Parade " },
      137 => {branch_code: '037', branch_name: "UOB Suntec City" },
      138 => {branch_code: '038', branch_name: 'UOB Tampines' },
      139 => {branch_code: '039', branch_name: 'UOB Northpoint' },
      140 => {branch_code: '040', branch_name: 'UOB Changi Airport ' },
      141 => {branch_code: '041', branch_name: 'UOB Bukit Batok Central ' },
      142 => {branch_code: '042', branch_name: 'UOB Coleman' },
      143 => {branch_code: '043', branch_name: 'UOB Changi Airport ' },
      144 => {branch_code: '044', branch_name: 'UOB Pasir Ris ' },
      145 => {branch_code: '045', branch_name: 'UOB Woodlands ' },
      146 => {branch_code: '046', branch_name: 'UOB Coleman ' },
      147 => {branch_code: '047', branch_name: 'UOB Rochor' },
      148 => {branch_code: '048', branch_name: 'UOB Coleman' },
      150 => {branch_code: '050', branch_name: 'UOB Tiong Bahru Plaza ' },
      151 => {branch_code: '051', branch_name: 'UOB Bukit Batok Central ' },
      152 => {branch_code: '052', branch_name: 'UOB Suntec City' },
      153 => {branch_code: '053', branch_name: 'UOB Boon Lay' },
      154 => {branch_code: '054', branch_name: 'UOB Bukit Panjang ' },
      155 => {branch_code: '055', branch_name: 'UOB Tampines' },
      156 => {branch_code: '056', branch_name: 'UOB Bukit Panjang ' },
      157 => {branch_code: '057', branch_name: 'UOB Anson Road' },
      158 => {branch_code: '058', branch_name: 'UOB Jalan Sultan' },
      159 => {branch_code: '059', branch_name: 'UOB Upper Bukit Timah ' },
      160 => {branch_code: '060', branch_name: 'UOB Vivo City' },
      162 => {branch_code: '062', branch_name: 'UOB Katong' },
      163 => {branch_code: '063', branch_name: 'UOB Hougang' },
      164 => {branch_code: '064', branch_name: 'UOB City Plaza' },
      166 => {branch_code: '066', branch_name: 'UOB Bishan' },
      167 => {branch_code: '067', branch_name: 'UOB Bendemeer' },
      168 => {branch_code: '068', branch_name: 'UOB Orchard' },
      169 => {branch_code: '069', branch_name: 'UOB Macpherson' },
      180 => {branch_code: '080', branch_name: 'UOB Main' },
      201 => {branch_code: '057', branch_name: 'UOB Anson Road' },
      202 => {branch_code: '058', branch_name: 'UOB Jalan Sultan' },
      203 => {branch_code: '059', branch_name: 'UOB Upper Bukit Timah ' },
      204 => {branch_code: '058', branch_name: 'UOB Jalan Sultan' },
      206 => {branch_code: '060', branch_name: 'UOB Vivo City' },
      207 => {branch_code: '062', branch_name: 'UOB Katong' },
      208 => {branch_code: '059', branch_name: 'UOB Upper Bukit Timah ' },
      209 => {branch_code: '063', branch_name: 'UOB Hougang' },
      210 => {branch_code: '060', branch_name: 'UOB Vivo City' },
      211 => {branch_code: '064', branch_name: 'UOB City Plaza' },
      212 => {branch_code: '066', branch_name: 'UOB Bishan' },
      213 => {branch_code: '063', branch_name: 'UOB Hougang' },
      215 => {branch_code: '060', branch_name: 'UOB Vivo City' },
      216 => {branch_code: '067', branch_name: 'UOB Bendemeer' },
      217 => {branch_code: '068', branch_name: 'UOB Orchard' },
      218 => {branch_code: '067', branch_name: 'UOB Bendemeer' },
      219 => {branch_code: '069', branch_name: 'UOB Macpherson' },
      3013 => {branch_code: '001', branch_name: 'UOB Main' },
      3011 => {branch_code: '046', branch_name: 'UOB Coleman' },
      302 => {branch_code: '046', branch_name: 'UOB Coleman' },
      303 => {branch_code: '047', branch_name: 'UOB Rochor' },
      304 => {branch_code: '048', branch_name: 'UOB Coleman' },
      307 => {branch_code: '307', branch_name: 'UOB Great World City' },
      308 => {branch_code: '308', branch_name: 'UOB Admiralty' },
      309 => {branch_code: '002', branch_name: 'UOB Jalan Sultan' },
      310 => {branch_code: '004', branch_name: 'UOB Tai Seng' },
      311 => {branch_code: '311', branch_name: 'UOB Coleman' },
      312 => {branch_code: '006', branch_name: 'UOB Novena Square' },
      314 => {branch_code: '007', branch_name: 'UOB Thomson' },
      318 => {branch_code: '009', branch_name: 'UOB Tanjong Pagar' },
      320 => {branch_code: '320', branch_name: 'UOB Orchard' },
      321 => {branch_code: '037', branch_name: 'UOB Suntec City' },
      324 => {branch_code: '012', branch_name: 'UOB Bukit Panjang' },
      327 => {branch_code: '327', branch_name: 'UOB Ang Mo Kio' },
      328 => {branch_code: '328', branch_name: 'UOB Bedok' },
      330 => {branch_code: '013', branch_name: 'UOB Jurong Point' },
      332 => {branch_code: '332', branch_name: 'UOB Farrer Park' },
      335 => {branch_code: '014', branch_name: 'UOB City Plaza' },
      336 => {branch_code: '336', branch_name: 'UOB JEM' },
      337 => {branch_code: '064', branch_name: 'UOB City Plaza' },
      339 => {branch_code: '016', branch_name: 'UOB Novena Square' },
      340 => {branch_code: '019', branch_name: 'UOB New Bridge' },
      341 => {branch_code: '020', branch_name: 'UOB Holland' },
      343 => {branch_code: '343', branch_name: 'UOB South Bridge' },
      344 => {branch_code: '024', branch_name: 'UOB Serangoon Garden' },
      346 => {branch_code: '346', branch_name: 'UOB Northpoint' },
      347 => {branch_code: '026', branch_name: 'UOB Bukit Timah' },
      348 => {branch_code: '027', branch_name: 'UOB Bedok' },
      349 => {branch_code: '028', branch_name: 'UOB Ang Mo Kio' },
      350 => {branch_code: '001', branch_name: 'UOB Main' },
      351 => {branch_code: '351', branch_name: 'UOB Main' },
      352 => {branch_code: '001', branch_name: 'UOB Main' },
      353 => {branch_code: '066', branch_name: 'UOB Bishan' },
      354 => {branch_code: '047', branch_name: 'UOB Rochor' },
      355 => {branch_code: '015', branch_name: 'UOB Toa Payoh' },
      356 => {branch_code: '062', branch_name: 'UOB Katong' },
      357 => {branch_code: '018', branch_name: 'UOB Scotts Square' },
      358 => {branch_code: '446', branch_name: 'UOB Northpoint' },
      359 => {branch_code: '029', branch_name: 'UOB Scotts Square' },
      360 => {branch_code: '030', branch_name: 'UOB Clementi' },
      361 => {branch_code: '031', branch_name: 'UOB Katong' },
      362 => {branch_code: '032', branch_name: 'UOB Aljunied' },
      363 => {branch_code: '035', branch_name: 'UOB Boon Lay' },
      364 => {branch_code: '036', branch_name: 'UOB Parkway Parade' },
      365 => {branch_code: '037', branch_name: 'UOB Suntec City' },
      366 => {branch_code: '038', branch_name: 'UOB Tampines' },
      367 => {branch_code: '039', branch_name: 'UOB Northpoint' },
      368 => {branch_code: '040', branch_name: 'UOB Changi Airport' },
      369 => {branch_code: '041', branch_name: 'UOB Bukit Batok Central' },
      370 => {branch_code: '044', branch_name: 'UOB Pasir Ris' },
      371 => {branch_code: '045', branch_name: 'UOB Woodlands' },
      372 => {branch_code: '046', branch_name: 'UOB Coleman' },
      373 => {branch_code: '050', branch_name: 'UOB Tiong Bahru Plaza' },
      374 => {branch_code: '057', branch_name: 'UOB Anson Road' },
      375 => {branch_code: '059', branch_name: 'UOB Upper Bukit Timah' },
      376 => {branch_code: '060', branch_name: 'UOB Vivo City' },
      377 => {branch_code: '064', branch_name: 'UOB City Plaza' },
      378 => {branch_code: '063', branch_name: 'UOB Hougang' },
      379 => {branch_code: '067', branch_name: 'UOB Bendemeer' },
      380 => {branch_code: '068', branch_name: 'UOB Orchard' },
      381 => {branch_code: '307', branch_name: 'UOB Great World City' },
      382 => {branch_code: '308', branch_name: 'UOB Admiralty' },
      383 => {branch_code: '311', branch_name: 'UOB Coleman' },
      384 => {branch_code: '320', branch_name: 'UOB Orchard' },
      385 => {branch_code: '327', branch_name: 'UOB Ang Mo Kio' },
      386 => {branch_code: '328', branch_name: 'UOB Bedok' },
      387 => {branch_code: '332', branch_name: 'UOB Farrer Park' },
      388 => {branch_code: '336', branch_name: 'UOB JEM'},
      389 => {branch_code: '343', branch_name: 'UOB South Bridge'},
      390 => {branch_code: '351', branch_name: 'UOB Main'},
      391 => {branch_code: '431', branch_name: 'UOB Shenton Way'},
      392 => {branch_code: '432', branch_name: 'UOB Jalan Sultan'},
      393 => {branch_code: '437', branch_name: 'UOB Tiong Bahru Plaza'},
      394 => {branch_code: '441', branch_name: 'UOB West Coast'},
      395 => {branch_code: '447', branch_name: 'UOB Serangoon Central'},
      396 => {branch_code: '448', branch_name: 'UOB Hougang MRT'},
      397 => {branch_code: '001', branch_name: 'UOB Main'},
      398 => {branch_code: '001', branch_name: 'UOB Main'},
      399 => {branch_code: '492', branch_name: 'UOB Raffles City'},
      401 => {branch_code: '431', branch_name: 'UOB Shenton Way'},
      402 => {branch_code: '432', branch_name: 'UOB Jalan Sultan'},
      403 => {branch_code: '432', branch_name: 'UOB Jalan Sultan'},
      404 => {branch_code: '432', branch_name: 'UOB Jalan Sultan'},
      405 => {branch_code: '447', branch_name: 'UOB Serangoon Central'},
      406 => {branch_code: '328', branch_name: 'UOB Bedok'},
      407 => {branch_code: '437', branch_name: 'UOB Tiong Bahru Plaza'},
      408 => {branch_code: '028', branch_name: 'UOB Ang Mo Kio'},
      409 => {branch_code: '328', branch_name: 'UOB Bedok'},
      410 => {branch_code: '336', branch_name: 'UOB JEM'},
      411 => {branch_code: '441', branch_name: 'UOB West Coast'},
      412 => {branch_code: '432', branch_name: 'UOB Jalan Sultan'},
      413 => {branch_code: '447', branch_name: 'UOB Serangoon Central'},
      414 => {branch_code: '441', branch_name: 'UOB West Coast'},
      415 => {branch_code: '336', branch_name: 'UOB JEM'},
      416 => {branch_code: '446', branch_name: 'UOB Northpoint'},
      417 => {branch_code: '447', branch_name: 'UOB Serangoon Central'},
      419 => {branch_code: '001', branch_name: 'UOB Main'},
      420 => {branch_code: '493', branch_name: 'UOB Rivervale Mall'},
      421 => {branch_code: '494', branch_name: 'UOB Raffles City'},
      422 => {branch_code: '495', branch_name: 'UOB Vivo City'},
      423 => {branch_code: '496', branch_name: 'UOB Toa Payoh Lite'},
      424 => {branch_code: '497', branch_name: 'UOB Marina Bay Financial Ctr '},
      425 => {branch_code: '418', branch_name: 'UOB Suntec City'},
      426 => {branch_code: '068', branch_name: 'UOB Orchard'},
      427 => {branch_code: '001', branch_name: 'UOB Main'},
      428 => {branch_code: '038', branch_name: 'UOB Tampines'},
      431 => {branch_code: '431', branch_name: 'UOB Shenton Way'},
      432 => {branch_code: "432", branch_name: 'UOB Jalan Sultan'},
      433 => {branch_code: "001", branch_name: 'UOB Main'},
      435 => {branch_code: "028", branch_name: 'UOB Ang Mo Kio'},
      437 => {branch_code: "437", branch_name: 'UOB Tiong Bahru Plaza'},
      441 => {branch_code: "441", branch_name: 'UOB West Coast'},
      446 => {branch_code: "446", branch_name: 'UOB Northpoint'},
      447 => {branch_code: "447", branch_name: 'UOB Serangoon Central'},
      448 => {branch_code: "448", branch_name: 'UOB Hougang MRT'},
      450 => {branch_code: "001", branch_name: 'UOB Main'},
      451 => {branch_code: "001", branch_name: 'UOB Main'},
      455 => {branch_code: "045", branch_name: 'UOB Woodlands'},
      456 => {branch_code: "001", branch_name: 'UOB Main'},
      457 => {branch_code: "015", branch_name: 'UOB Toa Payoh'},
      492 => {branch_code: "492", branch_name: 'UOB Raffles City'},
      493 => {branch_code: "493", branch_name: 'UOB Rivervale Mall'},
      494 => {branch_code: "494", branch_name: 'UOB Raffles City'},
      495 => {branch_code: "495", branch_name: 'UOB Vivo city'},
      501 => {branch_code: "001", branch_name: 'FEB Main'},
      502 => {branch_code: "002", branch_name: 'FEB Main'},
      503 => {branch_code: "003", branch_name: 'FEB Main'},
      504 => {branch_code: "004", branch_name: 'FEB Main'},
      505 => {branch_code: "005", branch_name: 'FEB Main'},
      506 => {branch_code: "001", branch_name: 'FEB Main'},
      507 => {branch_code: "003", branch_name: 'FEB Main'},
      508 => {branch_code: "004", branch_name: 'FEB Main'},
      631 => {branch_code: "630", branch_name: 'UOB Marina Bay Financial Ctr'},
      633 => {branch_code: "632", branch_name: 'UOB Wealth Banking Scotts Square'},
      636 => {branch_code: "635", branch_name: 'UOB Wealth Banking Tampines'},
      638 => {branch_code: "637", branch_name: 'UOB MBFC Privilege'},
      640 => {branch_code: "639", branch_name: 'UOB Wealth Banking Katong'},
      642 => {branch_code: "641", branch_name: 'UOB PBC Serangoon Garden'},
      643 => {branch_code: "643", branch_name: 'UOB Wealth Banking JEM'},
      645 => {branch_code: "013", branch_name: 'UOB Jurong Point'},
      650 => {branch_code: "643", branch_name: 'UOB Wealth Banking JEM'},
      651 => {branch_code: "651", branch_name: 'UOB Private Bank'},
      668 => {branch_code: "497", branch_name: 'UOB Marina Bay Financial Ctr'},
      688 => {branch_code: "651", branch_name: 'UOB Private Bank'},
      901 => {branch_code: "001", branch_name: 'UOB Main'},
      902 => {branch_code: "343", branch_name: 'UOB South Bridge'},
      903 => {branch_code: "343", branch_name: 'UOB South Bridge'},
      904 => {branch_code: "332", branch_name: 'UOB Farrer Park'},
      905 => {branch_code: "320", branch_name: 'UOB Orchard'},
      906 => {branch_code: "004", branch_name: 'UOB Tai Seng'},
      907 => {branch_code: "307", branch_name: 'UOB Great World City'},
      908 => {branch_code: "308", branch_name: 'UOB Admiralty'},
      909 => {branch_code: "307", branch_name: 'UOB Great World City'},
      910 => {branch_code: "030", branch_name: 'UOB Clementi'},
      911 => {branch_code: "311", branch_name: 'UOB Coleman'},
      912 => {branch_code: "032", branch_name: 'UOB Aljunied'},
      913 => {branch_code: "062", branch_name: 'UOB Katong'},
      914 => {branch_code: "063", branch_name: 'UOB Hougang'},
      915 => {branch_code: "015", branch_name: 'UOB Toa Payoh'},
      916 => {branch_code: "014", branch_name: 'UOB City Plaza'},
      917 => {branch_code: "013", branch_name: 'UOB Jurong Point'},
      918 => {branch_code: "343", branch_name: 'UOB South Bridge'},
      919 => {branch_code: "067", branch_name: 'UOB Bendemeer'},
      920 => {branch_code: "320", branch_name: 'UOB Orchard'},
      921 => {branch_code: "037", branch_name: 'UOB Suntec City'},
      922 => {branch_code: "001", branch_name: 'UOB Main'},
      923 => {branch_code: "007", branch_name: 'UOB Thomson'},
      924 => {branch_code: "311", branch_name: 'UOB Coleman'},
      925 => {branch_code: "050", branch_name: 'UOB Tiong Bahru Plaza'},
      926 => {branch_code: "059", branch_name: 'UOB Upper Bukit Timah'},
      927 => {branch_code: "327", branch_name: 'UOB Ang Mo Kio'},
      928 => {branch_code: "328", branch_name: 'UOB Bedok'},
      929 => {branch_code: "030", branch_name: 'UOB Clementi'},
      930 => {branch_code: "038", branch_name: 'UOB Tampines'},
      931 => {branch_code: "032", branch_name: 'UOB Aljunied'},
      932 => {branch_code: "332", branch_name: 'UOB Farrer Park'},
      933 => {branch_code: "063", branch_name: 'UOB Hougang'},
      934 => {branch_code: "343", branch_name: 'UOB South Bridge'},
      935 => {branch_code: "038", branch_name: 'UOB Tampines'},
      936 => {branch_code: "336", branch_name: 'UOB JEM'},
      937 => {branch_code: "001", branch_name: 'UOB Main'},
      938 => {branch_code: "038", branch_name: 'UOB Tampines'},
      942 => {branch_code: "001", branch_name: 'UOB Main'},
      945 => {branch_code: "035", branch_name: 'UOB Boon Lay'},
      946 => {branch_code: "346", branch_name: 'UOB Northpoint'},
      951 => {branch_code: "001", branch_name: 'UOB Main'},
      952 => {branch_code: '343', branch_name: 'UOB South Bridge'},
      953 => {branch_code: '343', branch_name: 'UOB South Bridge'},
      954 => {branch_code: '332', branch_name: 'UOB Farrer Park'},
      955 => {branch_code: '320', branch_name: 'UOB Orchard'},
      956 => {branch_code: '004', branch_name: 'UOB Tai Seng'},
      957 => {branch_code: '307', branch_name: 'UOB Great World City'},
      958 => {branch_code: '308', branch_name: 'UOB Admiralty'},
      959 => {branch_code: '307', branch_name: 'UOB Great World City'},
      960 => {branch_code: '030', branch_name: 'UOB Clementi'},
      961 => {branch_code: '311', branch_name: 'UOB Coleman'},
      962 => {branch_code: '032', branch_name: 'UOB Aljunied'},
      963 => {branch_code: '062', branch_name: 'UOB Katong'},
      964 => {branch_code: '063', branch_name: 'UOB Hougang'},
      965 => {branch_code: '015', branch_name: 'UOB Toa Payoh'},
      966 => {branch_code: '014', branch_name: 'UOB City Plaza'},
      967 => {branch_code: '013', branch_name: 'UOB Jurong Point'},
      968 => {branch_code: '343', branch_name: 'UOB South Bridge'},
      969 => {branch_code: '067', branch_name: 'UOB Bendemeer'},
      970 => {branch_code: '320', branch_name: 'UOB Orchard'},
      971 => {branch_code: '037', branch_name: 'UOB Suntec City'},
      972 => {branch_code: '001', branch_name: 'UOB Main'},
      973 => {branch_code: '007', branch_name: 'UOB Thomson'},
      974 => {branch_code: '311', branch_name: 'UOB Coleman'},
      975 => {branch_code: '050', branch_name: 'UOB Tiong Bahru Plaza'},
      976 => {branch_code: '059', branch_name: 'UOB Upper Bukit Timah'},
      977 => {branch_code: '327', branch_name: 'UOB Ang Mo Kio'},
      978 => {branch_code: '328', branch_name: 'UOB Bedok'},
      979 => {branch_code: '030', branch_name: 'UOB Clementi'},
      980 => {branch_code: '038', branch_name: 'UOB Tampines'},
      981 => {branch_code: '032', branch_name: 'UOB Aljunied'},
      982 => {branch_code: '332', branch_name: 'UOB Farrer Park'},
      983 => {branch_code: '063', branch_name: 'UOB Hougang'},
      984 => {branch_code: '343', branch_name: 'UOB South Bridge'},
      985 => {branch_code: '038', branch_name: 'UOB Tampines'},
      986 => {branch_code: '336', branch_name: 'UOB JEM'},
      987 => {branch_code: '001', branch_name: 'UOB Main'},
      988 => {branch_code: '038', branch_name: 'UOB Tampines'},
      989 => {branch_code: '001', branch_name: 'UOB Main'},
      990 => {branch_code: '001', branch_name: 'UOB Main'},
      992 => {branch_code: '001', branch_name: 'UOB Main'},
      993 => {branch_code: '001', branch_name: 'UOB Main'},
      995 => {branch_code: '035', branch_name: 'UOB Boon Lay'},
      996 => {branch_code: '346', branch_name: 'UOB Northpoint'},
    }
  end
end