Class: ScbiHeader
- Inherits:
-
Object
- Object
- ScbiHeader
- Defined in:
- lib/scbi_headers/scbi_header.rb
Overview
A class to print information headers in all command line applications of SCBI
Instance Attribute Summary collapse
-
#articles ⇒ Object
Returns the value of attribute articles.
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#copyright ⇒ Object
Returns the value of attribute copyright.
-
#description ⇒ Object
Returns the value of attribute description.
-
#l1_separator_char ⇒ Object
Returns the value of attribute l1_separator_char.
-
#l2_separator_char ⇒ Object
Returns the value of attribute l2_separator_char.
-
#program_name ⇒ Object
Returns the value of attribute program_name.
-
#program_version ⇒ Object
Returns the value of attribute program_version.
-
#title ⇒ Object
Returns the value of attribute title.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #default_title ⇒ Object
-
#initialize(program_name, program_version, use_default_title = true, width = 80) ⇒ ScbiHeader
constructor
A new instance of ScbiHeader.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(program_name, program_version, use_default_title = true, width = 80) ⇒ ScbiHeader
Returns a new instance of ScbiHeader.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/scbi_headers/scbi_header.rb', line 11 def initialize(program_name, program_version, use_default_title = true, width = 80) @res=[] @comment_char='#' @l1_separator_char='=' @l2_separator_char='*' @l3_separator_char='-' @title=[] @copyright='' if use_default_title default_title end @authors=[] @articles=[] @program_name=program_name @description=description @program_version=program_version @width=width end |
Instance Attribute Details
#articles ⇒ Object
Returns the value of attribute articles.
9 10 11 |
# File 'lib/scbi_headers/scbi_header.rb', line 9 def articles @articles end |
#authors ⇒ Object
Returns the value of attribute authors.
9 10 11 |
# File 'lib/scbi_headers/scbi_header.rb', line 9 def @authors end |
#copyright ⇒ Object
Returns the value of attribute copyright.
9 10 11 |
# File 'lib/scbi_headers/scbi_header.rb', line 9 def copyright @copyright end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/scbi_headers/scbi_header.rb', line 7 def description @description end |
#l1_separator_char ⇒ Object
Returns the value of attribute l1_separator_char.
7 8 9 |
# File 'lib/scbi_headers/scbi_header.rb', line 7 def l1_separator_char @l1_separator_char end |
#l2_separator_char ⇒ Object
Returns the value of attribute l2_separator_char.
7 8 9 |
# File 'lib/scbi_headers/scbi_header.rb', line 7 def l2_separator_char @l2_separator_char end |
#program_name ⇒ Object
Returns the value of attribute program_name.
7 8 9 |
# File 'lib/scbi_headers/scbi_header.rb', line 7 def program_name @program_name end |
#program_version ⇒ Object
Returns the value of attribute program_version.
7 8 9 |
# File 'lib/scbi_headers/scbi_header.rb', line 7 def program_version @program_version end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/scbi_headers/scbi_header.rb', line 9 def title @title end |
#width ⇒ Object
Returns the value of attribute width.
7 8 9 |
# File 'lib/scbi_headers/scbi_header.rb', line 7 def width @width end |
Instance Method Details
#default_title ⇒ Object
36 37 38 39 40 41 |
# File 'lib/scbi_headers/scbi_header.rb', line 36 def default_title @title << "SuperComputing and BioInformatics - SCBI" @title << "University of Málaga - Spain" @title << "http://www.scbi.uma.es" end |
#inspect ⇒ Object
47 48 49 50 |
# File 'lib/scbi_headers/scbi_header.rb', line 47 def inspect populate_header @res.join("\n") end |
#to_s ⇒ Object
43 44 45 |
# File 'lib/scbi_headers/scbi_header.rb', line 43 def to_s inspect end |