Class: OpenURL::ContextObjectEntityFactory
- Inherits:
-
Object
- Object
- OpenURL::ContextObjectEntityFactory
show all
- Defined in:
- lib/openurl/context_object_entity.rb
Constant Summary
collapse
- @@factories =
[]
Class Method Summary
collapse
Class Method Details
.add_factory(factory) ⇒ Object
282
283
284
|
# File 'lib/openurl/context_object_entity.rb', line 282
def self.add_factory(factory)
@@factories.insert(0,factory)
end
|
.delete_factory_at(index) ⇒ Object
286
287
288
|
# File 'lib/openurl/context_object_entity.rb', line 286
def self.delete_factory_at(index)
@@factories.delete_at(index)
end
|
.factories ⇒ Object
301
302
303
|
# File 'lib/openurl/context_object_entity.rb', line 301
def self.factories
return @@factories
end
|
290
291
292
293
294
295
296
297
298
299
|
# File 'lib/openurl/context_object_entity.rb', line 290
def self.format(format_id)
@@factories.each { |factory|
if factory.identifiers.index(format_id)
return factory.create()
end
}
ent = OpenURL::ContextObjectEntity.new
ent.set_format(format_id)
return ent
end
|
.inherited(factory) ⇒ Object
278
279
280
|
# File 'lib/openurl/context_object_entity.rb', line 278
def self.inherited(factory)
@@factories.insert(0,factory)
end
|
.load(dirname) ⇒ Object
305
306
307
308
309
310
|
# File 'lib/openurl/context_object_entity.rb', line 305
def self.load(dirname)
Dir.open( dirname ).each { |fn|
next unless ( fn =~ /[.]rb$/ )
require "#{dirname}/#{fn}"
}
end
|