Class: GlobalID::Locator::BlockLocator

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

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ BlockLocator

Returns a new instance of BlockLocator.



229
230
231
# File 'lib/global_id/locator.rb', line 229

def initialize(block)
  @locator = block
end

Instance Method Details

#locate(gid, options = {}) ⇒ Object



233
234
235
# File 'lib/global_id/locator.rb', line 233

def locate(gid, options = {})
  @locator.call(gid, options)
end

#locate_many(gids, options = {}) ⇒ Object



237
238
239
# File 'lib/global_id/locator.rb', line 237

def locate_many(gids, options = {})
  gids.map { |gid| locate(gid, options) }
end