Class: Datagraph::Command::Count

Inherits:
Datagraph::Command show all
Defined in:
lib/datagraph/command/count.rb

Overview

Outputs the number of statements in a repository.

Instance Method Summary (collapse)

Methods inherited from Datagraph::Command

#basename, #parse_repository_specs, #parse_resource_specs, #validate_repository_specs, #validate_resource_specs

Methods included from Datagraph::Client

rpc

Instance Method Details

- execute(*repository_specs)

This method returns an undefined value.

Parameters:

  • (Array<String>) repository_specs


9
10
11
12
13
14
15
# File 'lib/datagraph/command/count.rb', line 9

def execute(*repository_specs)
  repositories = validate_repository_specs(repository_specs)
  count = repositories.inject(0) do |count, repository|
    count += repository.count
  end
  puts count.to_s
end