Skip to content

Commit

Permalink
Implement project statistics build and get
Browse files Browse the repository at this point in the history
  • Loading branch information
İsmail Akbudak committed Mar 12, 2018
1 parent 9f4aeaf commit f5170e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,12 @@
'assignToVendor' => false
}
puts project.create(model)

# Create project with files
puts project.create(model, files: %w[files/Test.txt files/Test-2.txt])

# Get project statistics
puts project.statistics(PROJECT_ID)

# Post project statistics build
puts project.statistics_build(PROJECT_ID)
8 changes: 8 additions & 0 deletions lib/smartcat_sdk/rest/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ def update(project_id, project_model)
def delete(project_id)
prepare_request(:delete, "#{@resource}/#{project_id}")
end

def statistics(project_id)
prepare_request(:get, "#{@resource}/#{project_id}/statistics")
end

def statistics_build(project_id)
prepare_request(:post, "#{@resource}/#{project_id}/statistics/build")
end
end
end
end

0 comments on commit f5170e2

Please sign in to comment.