Class: MagazineArticle

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

Instance Attribute Summary collapse

Attributes inherited from Reference

#authors, #date, #title

Instance Method Summary collapse

Methods inherited from Reference

#<=>, #get_title

Constructor Details

#initialize(authorsMagazine, titleMagazine, dateMagazine, magazine, number, volumen = nil, initpage, finalpage) ⇒ MagazineArticle

Returns a new instance of MagazineArticle.



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

def initialize(authorsMagazine, titleMagazine, dateMagazine, magazine, number, volumen=nil, initpage, finalpage)
  super(authorsMagazine, titleMagazine, dateMagazine)

  @magazine = magazine
  @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/magazinearticle.rb', line 9

def finalpage
  @finalpage
end

#initpageObject

Returns the value of attribute initpage.



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

def initpage
  @initpage
end

#magazineObject

Returns the value of attribute magazine.



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

def magazine
  @magazine
end

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

#volumeObject

Returns the value of attribute volume.



9
10
11
# File 'lib/prct11/magazinearticle.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/magazinearticle.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 += @magazine
  string += ", "
  if(!@volume.nil?)
    string += @volume.to_s
    string += " "
  end
  string += "(" + @number.to_s + ")"
  string += ", " + date
  string += "."
end