Class: Ruremai::Locator::Base
- Inherits:
-
Object
- Object
- Ruremai::Locator::Base
- Defined in:
- lib/ruremai/locator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(method) ⇒ Base
constructor
A new instance of Base.
- #located ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/ruremai/locator.rb', line 12 def name @name end |
#owner ⇒ Object (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
#located ⇒ Object
20 21 22 |
# File 'lib/ruremai/locator.rb', line 20 def located candidates.detect {|uri| exist?(uri) } end |