Module: Subledger::Store::Api::Progress

Included in:
Store
Defined in:
lib/subledger/store/api/roles/progress.rb

Instance Method Summary collapse

Instance Method Details

#progress(progressable) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/subledger/store/api/roles/progress.rb', line 5

def progress progressable

  path = Path.for_entity( :anchor => progressable ) + '/progress'

  begin
    response_hash = parse_json(
                      http.get( path ).body )
  rescue Exception => e
    raise ProgressError, "Cannot progress #{progressable}: #{e}"
  end

  response_hash['progress']['percentage'].to_i
end