Class: IbanCalculator::BicCandidate
- Inherits:
-
Object
- Object
- IbanCalculator::BicCandidate
- Defined in:
- lib/iban_calculator/bic_candidate.rb
Instance Attribute Summary collapse
-
#bic ⇒ Object
Returns the value of attribute bic.
-
#city ⇒ Object
Returns the value of attribute city.
-
#sample_url ⇒ Object
Returns the value of attribute sample_url.
-
#www_count ⇒ Object
Returns the value of attribute www_count.
-
#zip ⇒ Object
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(opts = {}) ⇒ Object
-
#initialize(raw_attributes = {}) ⇒ BicCandidate
constructor
A new instance of BicCandidate.
- #source ⇒ Object
Constructor Details
#initialize(raw_attributes = {}) ⇒ BicCandidate
Returns a new instance of BicCandidate.
9 10 11 12 13 14 15 |
# File 'lib/iban_calculator/bic_candidate.rb', line 9 def initialize(raw_attributes = {}) self.bic = raw_attributes[:bic] self.zip = string_or_default(raw_attributes[:zip]) self.city = string_or_default(raw_attributes[:city]) self.sample_url = string_or_default(raw_attributes[:sampleurl]) self.www_count = raw_attributes[:wwwcount].to_i end |
Instance Attribute Details
#bic ⇒ Object
Returns the value of attribute bic.
3 4 5 |
# File 'lib/iban_calculator/bic_candidate.rb', line 3 def bic @bic end |
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/iban_calculator/bic_candidate.rb', line 3 def city @city end |
#sample_url ⇒ Object
Returns the value of attribute sample_url.
3 4 5 |
# File 'lib/iban_calculator/bic_candidate.rb', line 3 def sample_url @sample_url end |
#www_count ⇒ Object
Returns the value of attribute www_count.
3 4 5 |
# File 'lib/iban_calculator/bic_candidate.rb', line 3 def www_count @www_count end |
#zip ⇒ Object
Returns the value of attribute zip.
3 4 5 |
# File 'lib/iban_calculator/bic_candidate.rb', line 3 def zip @zip end |
Class Method Details
.build_list(raw_response) ⇒ Object
5 6 7 |
# File 'lib/iban_calculator/bic_candidate.rb', line 5 def self.build_list(raw_response) Array.wrap(raw_response[:item]).map { |candidate| new(candidate) } end |
Instance Method Details
#as_json(opts = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/iban_calculator/bic_candidate.rb', line 21 def as_json(opts = {}) { bic: bic, zip: zip, city: city, sample_url: sample_url, www_count: www_count, }.deep_stringify_keys! end |
#source ⇒ Object
17 18 19 |
# File 'lib/iban_calculator/bic_candidate.rb', line 17 def source www_count > 0 ? :www : :directory end |