Class: LoyalIpinfo::Worker
- Inherits:
-
Object
- Object
- LoyalIpinfo::Worker
- Defined in:
- lib/loyal_ipinfo/worker.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#library_file_path ⇒ Object
readonly
Returns the value of attribute library_file_path.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Worker
constructor
A new instance of Worker.
Constructor Details
#initialize(attrs = {}) ⇒ Worker
Returns a new instance of Worker.
9 10 11 12 13 14 15 16 17 |
# File 'lib/loyal_ipinfo/worker.rb', line 9 def initialize attrs={} @adapter ||= (attrs[:adapter] || ::LoyalIpinfo.config.default_adapter) @library_file_path ||= (attrs[:library_file_path] || ::LoyalIpinfo.config.default_library_file_path) case self.adapter when :qqwry self.extend ::LoyalIpinfo::QQwryAdapter end end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
7 8 9 |
# File 'lib/loyal_ipinfo/worker.rb', line 7 def adapter @adapter end |
#library_file_path ⇒ Object (readonly)
Returns the value of attribute library_file_path.
7 8 9 |
# File 'lib/loyal_ipinfo/worker.rb', line 7 def library_file_path @library_file_path end |