Class: Multisync::Catalog
- Inherits:
-
Object
- Object
- Multisync::Catalog
- Defined in:
- lib/multisync/catalog.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
top entity of definition.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ Catalog
constructor
A new instance of Catalog.
- #path ⇒ Object
- #traverse(visitor) ⇒ Object
Constructor Details
#initialize(path) ⇒ Catalog
Returns a new instance of Catalog.
6 7 8 |
# File 'lib/multisync/catalog.rb', line 6 def initialize path @path = File.(path) end |
Instance Attribute Details
#definition ⇒ Object (readonly)
top entity of definition
4 5 6 |
# File 'lib/multisync/catalog.rb', line 4 def definition @definition end |
Class Method Details
.default_catalog_path ⇒ Object
26 27 28 |
# File 'lib/multisync/catalog.rb', line 26 def self.default_catalog_path '~/.multisync.rb' end |
Instance Method Details
#path ⇒ Object
20 21 22 23 24 |
# File 'lib/multisync/catalog.rb', line 20 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 |
#traverse(visitor) ⇒ Object
16 17 18 |
# File 'lib/multisync/catalog.rb', line 16 def traverse visitor definition.accept visitor end |