Class: LoyalIpinfo::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/loyal_ipinfo/worker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#adapterObject (readonly)

Returns the value of attribute adapter.



7
8
9
# File 'lib/loyal_ipinfo/worker.rb', line 7

def adapter
  @adapter
end

#library_file_pathObject (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