lib/turkish_banks/branch.rb in turkish_banks-0.6.0 vs lib/turkish_banks/branch.rb in turkish_banks-1.0.0

- old
+ new

@@ -1,16 +1,17 @@ module TurkishBanks - class Branch < TurkishBank - attr_accessor :name, :code, :bank_code, :city_code, :city, :district_code, :district, :phone + class Branch + attr_reader :name, :code, :bank_code, :city_code, + :city, :district_code, :district, :phone - def initialize(branch) - @name = branch["sAd"] - @code = branch["sKd"] - @bank_code = branch["bKd"] - @city_code = branch["sIlKd"] - @city = branch["sIlAd"] - @district_code = branch["sIlcKd"] - @district = branch["sIlcAd"] - @phone = branch["tlf"] + def initialize(branch_params) + @name = branch_params['sAd'] + @code = branch_params['sKd'] + @bank_code = branch_params['bKd'] + @city_code = branch_params['sIlKd'] + @city = branch_params['sIlAd'] + @district_code = branch_params['sIlcKd'] + @district = branch_params['sIlcAd'] + @phone = branch_params['tlf'] end end end