Class: Bio::FlatFileIndex::Template::NameSpace
- Inherits:
-
Object
- Object
- Bio::FlatFileIndex::Template::NameSpace
- Defined in:
- lib/bio/io/flatfile/index.rb
Overview
templates of namespace
Internal use only.
Instance Attribute Summary (collapse)
-
- (Object) dbname
readonly
Returns the value of attribute dbname.
-
- (Object) file
readonly
Returns the value of attribute file.
-
- (Object) name
readonly
Returns the value of attribute name.
Instance Method Summary (collapse)
- - (Object) close
- - (Object) filename
- - (Boolean) include?(key)
-
- (NameSpace) initialize(dbname, name)
constructor
A new instance of NameSpace.
- - (Object) mapping(filename)
- - (Object) search(key)
Constructor Details
- (NameSpace) initialize(dbname, name)
A new instance of NameSpace
457 458 459 460 461 462 |
# File 'lib/bio/io/flatfile/index.rb', line 457 def initialize(dbname, name) @dbname = dbname @name = name.dup @name.freeze @file = mapping(filename) end |
Instance Attribute Details
- (Object) dbname (readonly)
Returns the value of attribute dbname
463 464 465 |
# File 'lib/bio/io/flatfile/index.rb', line 463 def dbname @dbname end |
- (Object) file (readonly)
Returns the value of attribute file
463 464 465 |
# File 'lib/bio/io/flatfile/index.rb', line 463 def file @file end |
- (Object) name (readonly)
Returns the value of attribute name
463 464 465 |
# File 'lib/bio/io/flatfile/index.rb', line 463 def name @name end |
Instance Method Details
- (Object) close
470 471 472 |
# File 'lib/bio/io/flatfile/index.rb', line 470 def close @file.close end |
- (Object) filename
446 447 448 449 |
# File 'lib/bio/io/flatfile/index.rb', line 446 def filename # should be redifined in child class raise NotImplementedError, "should be redefined in child class" end |
- (Boolean) include?(key)
474 475 476 477 478 479 480 481 |
# File 'lib/bio/io/flatfile/index.rb', line 474 def include?(key) r = search(key) unless r.empty? then key else nil end end |
- (Object) mapping(filename)
451 452 453 454 455 |
# File 'lib/bio/io/flatfile/index.rb', line 451 def mapping(filename) # should be redifined in child class raise NotImplementedError, "should be redefined in child class" #Flat_1::FlatMappingFile.new(filename) end |
- (Object) search(key)
465 466 467 468 |
# File 'lib/bio/io/flatfile/index.rb', line 465 def search(key) @file.open @file.search(key) end |