Class: TheLocal::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/the_local/interface.rb

Constant Summary collapse

FILE =
File.join("the_local", "interface.yml")

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(declaration) ⇒ Interface

Returns a new instance of Interface.



14
15
16
# File 'lib/the_local/interface.rb', line 14

def initialize(declaration)
  @declaration = declaration || {}
end

Class Method Details

.at(gem_root) ⇒ Object



9
10
11
12
# File 'lib/the_local/interface.rb', line 9

def self.at(gem_root)
  path = File.join(gem_root, FILE)
  new(File.exist?(path) ? YAML.safe_load_file(path) : nil)
end

Instance Method Details

#entry_points_for(facet) ⇒ Object



22
23
24
# File 'lib/the_local/interface.rb', line 22

def entry_points_for(facet)
  @declaration[facet] || []
end

#scopeObject



18
19
20
# File 'lib/the_local/interface.rb', line 18

def scope
  @declaration["scope"]
end