Class: GlobalID::Locator::BlockLocator
- Inherits:
-
Object
- Object
- GlobalID::Locator::BlockLocator
- Defined in:
- lib/global_id/locator.rb
Instance Method Summary collapse
-
#initialize(block) ⇒ BlockLocator
constructor
A new instance of BlockLocator.
- #locate(gid) ⇒ Object
- #locate_many(gids, options = {}) ⇒ Object
Constructor Details
#initialize(block) ⇒ BlockLocator
Returns a new instance of BlockLocator.
174 175 176 |
# File 'lib/global_id/locator.rb', line 174 def initialize(block) @locator = block end |
Instance Method Details
#locate(gid) ⇒ Object
178 179 180 |
# File 'lib/global_id/locator.rb', line 178 def locate(gid) @locator.call(gid) end |
#locate_many(gids, options = {}) ⇒ Object
182 183 184 |
# File 'lib/global_id/locator.rb', line 182 def locate_many(gids, = {}) gids.map { |gid| locate(gid) } end |