Class: ScbiHeader

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#articlesObject

Returns the value of attribute articles.



9
10
11
# File 'lib/scbi_headers/scbi_header.rb', line 9

def articles
  @articles
end

#authorsObject

Returns the value of attribute authors.



9
10
11
# File 'lib/scbi_headers/scbi_header.rb', line 9

def authors
  @authors
end

Returns the value of attribute copyright.



9
10
11
# File 'lib/scbi_headers/scbi_header.rb', line 9

def copyright
  @copyright
end

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/scbi_headers/scbi_header.rb', line 7

def description
  @description
end

#l1_separator_charObject

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_charObject

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_nameObject

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_versionObject

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

#titleObject

Returns the value of attribute title.



9
10
11
# File 'lib/scbi_headers/scbi_header.rb', line 9

def title
  @title
end

#widthObject

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_titleObject



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

#inspectObject



47
48
49
50
# File 'lib/scbi_headers/scbi_header.rb', line 47

def inspect
  populate_header
  @res.join("\n")
end

#to_sObject



43
44
45
# File 'lib/scbi_headers/scbi_header.rb', line 43

def to_s
  inspect
end