module EventStore::HTTP::Controls::ReadStream::OutputSchema::Transformer

Public Class Methods

instance(raw_data) click to toggle source
# File lib/event_store/http/controls/read_stream/output_schema.rb, line 25
def self.instance(raw_data)
  raw_data.fetch('entries').map do |entry|
    edit_link = nil

    entry['links'].each do |link|
      if link.fetch('relation') == 'edit'
        edit_link = link.fetch 'uri'
        break
      end
    end

    edit_link
  end
end
json() click to toggle source
# File lib/event_store/http/controls/read_stream/output_schema.rb, line 21
def self.json
  JSON
end