Class: JournalArticle

Inherits:
Regularpublications show all
Defined in:
lib/prct11/journalarticle.rb

Direct Known Subclasses

DSLJournal

Instance Attribute Summary collapse

Attributes inherited from Reference

#authors, #date, #title

Instance Method Summary collapse

Methods inherited from Reference

#<=>, #get_title

Constructor Details

#initialize(authorsJournal, titleJournal, dateJournal, journal, number, volumen = nil, initpage, finalpage) ⇒ JournalArticle

Returns a new instance of JournalArticle.



11
12
13
14
15
16
17
18
19
# File 'lib/prct11/journalarticle.rb', line 11

def initialize(authorsJournal, titleJournal, dateJournal, journal, number, volumen=nil, initpage, finalpage)
	super(authorsJournal, titleJournal, dateJournal)

	@journal = journal
	@volume = volume
	@number = number
	@initpage = initpage
	@finalpage = finalpage
end

Instance Attribute Details

#finalpageObject

Returns the value of attribute finalpage.



9
10
11
# File 'lib/prct11/journalarticle.rb', line 9

def finalpage
  @finalpage
end

#initpageObject

Returns the value of attribute initpage.



9
10
11
# File 'lib/prct11/journalarticle.rb', line 9

def initpage
  @initpage
end

#journalObject

Returns the value of attribute journal.



9
10
11
# File 'lib/prct11/journalarticle.rb', line 9

def journal
  @journal
end

#numberObject

Returns the value of attribute number.



9
10
11
# File 'lib/prct11/journalarticle.rb', line 9

def number
  @number
end

#volumeObject

Returns the value of attribute volume.



9
10
11
# File 'lib/prct11/journalarticle.rb', line 9

def volume
  @volume
end

Instance Method Details

#to_sObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/prct11/journalarticle.rb', line 21

def to_s
	string = ""
       for i in (0..@authors.size-1)
   	    string += "#{authors[i]}"
           if (i != @authors.size-1)
               string += ", " 
           end
       end
	string +="\n"
	string += title
	string += ".\n"
	string += @journal
	string += ", "
	if(!@volume.nil?)
		string += @volume.to_s
		string += " "
	end
	string += "(" + @number.to_s + ")"
	string += ", " + date
	string += "."
end