Class: Multisync::Catalog
- Inherits:
-
Object
- Object
- Multisync::Catalog
- Defined in:
- lib/multisync/catalog.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
top entity of definition.
Class Method Summary collapse
Instance Method Summary collapse
- #filter(sets) ⇒ Object
-
#initialize(path) ⇒ Catalog
constructor
A new instance of Catalog.
- #list ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(path) ⇒ Catalog
Returns a new instance of Catalog.
9 10 11 |
# File 'lib/multisync/catalog.rb', line 9 def initialize path @path = File.(path) end |
Instance Attribute Details
#definition ⇒ Object (readonly)
top entity of definition
7 8 9 |
# File 'lib/multisync/catalog.rb', line 7 def definition @definition end |
Class Method Details
.default_catalog_path ⇒ Object
37 38 39 |
# File 'lib/multisync/catalog.rb', line 37 def self.default_catalog_path '~/.multisync.rb' end |
Instance Method Details
#filter(sets) ⇒ Object
25 26 27 28 29 |
# File 'lib/multisync/catalog.rb', line 25 def filter sets catalog_filter = Multisync::Catalog::Filter.new sets definition.accept(catalog_filter) catalog_filter.result end |
#list ⇒ Object
19 20 21 22 23 |
# File 'lib/multisync/catalog.rb', line 19 def list catalog_list = Multisync::Catalog::List.new definition.accept(catalog_list) catalog_list.result end |
#path ⇒ Object
31 32 33 34 35 |
# File 'lib/multisync/catalog.rb', line 31 def path return @path if File.exist? @path sample_path = File.('../../../sample/multisync.rb', __FILE__) raise RuntimeError.new, "No catalog found at #{@path}. Copy sample from #{sample_path} to #{@path} and adjust to your needs." end |