Class: Ruremai::Locator::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruremai/locator.rb

Direct Known Subclasses

Rurema::Ja

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method) ⇒ Base

Returns a new instance of Base.



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

def initialize(method)
  @method = method
  @name   = method.name
  @owner  = method.owner
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/ruremai/locator.rb', line 12

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



12
13
14
# File 'lib/ruremai/locator.rb', line 12

def owner
  @owner
end

Class Method Details

.locate(method) ⇒ Object



7
8
9
# File 'lib/ruremai/locator.rb', line 7

def locate(method)
  new(method).located
end

Instance Method Details

#locatedObject



20
21
22
# File 'lib/ruremai/locator.rb', line 20

def located
  candidates.detect {|uri| exist?(uri) }
end