Class: CQL::Repository

Inherits:
Object
  • Object
show all
Includes:
Queriable
Defined in:
lib/cql/repository.rb

Overview

A repository is a group of models. See the corresponding Cucumber documentation for details.

Instance Attribute Summary

Attributes included from Queriable

#query_root

Instance Method Summary collapse

Methods included from Queriable

#query

Constructor Details

#initialize(repository_root) ⇒ Repository

Creates a new repository object based on the passed directory path or model



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cql/repository.rb', line 11

def initialize(repository_root)
  case
    when repository_root.is_a?(String)
      root = CukeModeler::Directory.new(repository_root)
    when repository_root.class.to_s =~ /CukeModeler/
      root = repository_root
    else
      raise(ArgumentError, "Don't know how to make a repository from a #{repository_root.class}")
  end

  @query_root = root
end