Class: Valabn
- Inherits:
-
Object
- Object
- Valabn
- Defined in:
- lib/valabn.rb,
lib/valabn/utils.rb,
lib/valabn/lookup.rb,
lib/valabn/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.1.3"
Instance Method Summary collapse
- #exists?(options = {}) ⇒ Boolean
-
#initialize(number) ⇒ Valabn
constructor
Instance methods.
Constructor Details
#initialize(number) ⇒ Valabn
Instance methods
5 6 7 |
# File 'lib/valabn.rb', line 5 def initialize(number) @number = number.to_s.gsub(/\W/, '') end |
Instance Method Details
#exists?(options = {}) ⇒ Boolean
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/valabn.rb', line 9 def exists?( = {}) res = Valabn::Lookup.validate(@number, ) if res.any? && res[:search_by_ab_nv201408_response][:abr_payload_search_results][:response].keys.include?(:business_entity201408) [:detail] == true ? res : true elsif !res.nil? [:detail] == true ? res : false else nil end end |