Class: Ukemi::Services::Service
- Inherits:
-
Object
- Object
- Ukemi::Services::Service
show all
- Defined in:
- lib/ukemi/services/service.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.inherited(child) ⇒ Object
34
35
36
|
# File 'lib/ukemi/services/service.rb', line 34
def inherited(child)
Ukemi.services << child
end
|
Instance Method Details
#configurated? ⇒ Boolean
27
28
29
30
31
|
# File 'lib/ukemi/services/service.rb', line 27
def configurated?
config_keys.all? do |key|
ENV.key? key
end
end
|
#lookup(data) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/ukemi/services/service.rb', line 14
def lookup(data)
@data = data
case type
when "ip"
lookup_by_ip data
when "domain"
lookup_by_domain data
else
raise ArgumentError, "#{data} is not a valid input."
end
end
|
#name ⇒ Object
10
11
12
|
# File 'lib/ukemi/services/service.rb', line 10
def name
@name ||= self.class.to_s.split("::").last
end
|