Module: Ruremai

Defined in:
lib/ruremai.rb,
lib/ruremai/locator.rb,
lib/ruremai/version.rb,
lib/ruremai/locator/rurema.rb

Defined Under Namespace

Modules: Locator Classes: NoReferenceManualFound

Constant Summary collapse

VERSION =
'0.0.1'

Class Method Summary collapse

Class Method Details

.launch(method) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/ruremai.rb', line 14

def launch(method)
  if uri = locate(method)
    Launchy.open uri.to_s
  else
    raise NoReferenceManualFound
  end
end

.locate(method) ⇒ Object



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

def locate(method)
  locate_all(method).first
end

.locate_all(method) ⇒ Object



26
27
28
29
30
# File 'lib/ruremai.rb', line 26

def locate_all(method)
  locators.map {|locator|
    locator.locate(method)
  }.compact
end

.locatorsObject



32
33
34
# File 'lib/ruremai.rb', line 32

def locators
  @locators ||= [Locator::Rurema::Ja]
end

.locators=(list) ⇒ Object



36
37
38
# File 'lib/ruremai.rb', line 36

def locators=(list)
  @locators = list
end