Module: ShareNotify
- Defined in:
- lib/share_notify/search_response.rb,
lib/share_notify.rb,
lib/share_notify/version.rb,
lib/share_notify/push_document.rb
Overview
Encapsulates the response from the SHARE Search api
Defined Under Namespace
Modules: Metadata
Classes: API, PushDocument, SearchResponse
Constant Summary
collapse
- VERSION =
"0.1.0"
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
23
24
25
26
27
28
|
# File 'lib/share_notify.rb', line 23
def config
if @config.nil?
configure(File.join(root.to_s, 'config', 'share_notify.yml'))
end
@config
end
|
13
14
15
16
17
18
19
20
21
|
# File 'lib/share_notify.rb', line 13
def configure(value)
if value.nil? || value.is_a?(Hash)
@config = value
elsif value.is_a?(String)
@config = YAML.load(File.read(value))
else
raise InitializationError, "Unrecognized configuration: #{value.inspect}"
end
end
|
.root ⇒ Object
30
31
32
|
# File 'lib/share_notify.rb', line 30
def root
File.dirname(__dir__)
end
|