module Subledger::Store::Api::Read

Public Instance Methods

read(readable) click to toggle source
# File lib/subledger/store/api/roles/read.rb, line 5
def read readable
  path = Path.for_entity :anchor => readable

  begin
    json_body = http.get( path ).body
  rescue Exception => e
    raise ReadError, "Cannot read #{readable}: #{e}"
  end

  new_or_initialize json_body, readable
end