Class: Skala::AlephAdapter::GetRecord
- Inherits:
-
Object
- Object
- Skala::AlephAdapter::GetRecord
- Defined in:
- lib/skala/aleph_adapter/get_record.rb
Instance Method Summary collapse
- #call(record_id) ⇒ Object
-
#initialize(adapter) ⇒ GetRecord
constructor
A new instance of GetRecord.
Constructor Details
#initialize(adapter) ⇒ GetRecord
Returns a new instance of GetRecord.
5 6 7 |
# File 'lib/skala/aleph_adapter/get_record.rb', line 5 def initialize(adapter) @adapter = adapter end |
Instance Method Details
#call(record_id) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/skala/aleph_adapter/get_record.rb', line 9 def call(record_id) get_record = @adapter.restful_api.record(record_id).get(view: :full) { "_type" => "record", "_id" => record_id, "fields" => { "record" => "#{get_record[/<?.*?>/]}#{WeakXml.find("<record>", get_record).to_s}" }, "_source" => get_record } end |