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.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/scbi_headers/scbi_header.rb', line 10

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.



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

def articles
  @articles
end

#authorsObject

Returns the value of attribute authors.



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

def authors
  @authors
end

Returns the value of attribute copyright.



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

def copyright
  @copyright
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#l1_separator_charObject

Returns the value of attribute l1_separator_char.



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

def l1_separator_char
  @l1_separator_char
end

#l2_separator_charObject

Returns the value of attribute l2_separator_char.



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

def l2_separator_char
  @l2_separator_char
end

#program_nameObject

Returns the value of attribute program_name.



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

def program_name
  @program_name
end

#program_versionObject

Returns the value of attribute program_version.



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

def program_version
  @program_version
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#widthObject

Returns the value of attribute width.



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

def width
  @width
end

Instance Method Details

#default_titleObject



35
36
37
38
39
40
# File 'lib/scbi_headers/scbi_header.rb', line 35

def default_title

  @title << "SuperComputing and BioInformatics - SCBI"
  @title << "University of Malaga - Spain"
  @title << "http://www.scbi.uma.es"
end

#inspectObject



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

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

#to_sObject



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

def to_s
  inspect
end