Class: Qravan::Source
- Inherits:
-
Object
- Object
- Qravan::Source
- Defined in:
- lib/qravan/source.rb
Overview
Sources for data extractions class
Instance Attribute Summary collapse
-
#sources ⇒ Object
Returns the value of attribute sources.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(cargo = {}) ⇒ Source
constructor
A new instance of Source.
- #unpassworded ⇒ Object
Constructor Details
#initialize(cargo = {}) ⇒ Source
Returns a new instance of Source.
10 11 12 |
# File 'lib/qravan/source.rb', line 10 def initialize(cargo = {}) @sources ||= cargo.sources end |
Instance Attribute Details
#sources ⇒ Object
Returns the value of attribute sources.
8 9 10 |
# File 'lib/qravan/source.rb', line 8 def sources @sources end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/qravan/source.rb', line 14 def call(env) body = [unpassworded.to_json] status = 200 headers = { "content-type" => "application/json" } [status, headers, body] end |
#unpassworded ⇒ Object
22 23 24 25 |
# File 'lib/qravan/source.rb', line 22 def unpassworded sources.map { |key, value| sources[key]["password"] = "******" if sources[key]["password"] } sources end |