Class: APA
- Inherits:
-
Object
- Object
- APA
- Defined in:
- lib/biblio/apa.rb
Instance Attribute Summary collapse
-
#arg ⇒ Object
Returns the value of attribute arg.
-
#flag ⇒ Object
Returns the value of attribute flag.
-
#list ⇒ Object
Returns the value of attribute list.
Instance Method Summary collapse
-
#initialize(arg, flag) ⇒ APA
constructor
A new instance of APA.
- #insertar(arg) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(arg, flag) ⇒ APA
Returns a new instance of APA.
9 10 11 12 13 14 15 |
# File 'lib/biblio/apa.rb', line 9 def initialize(arg,flag) @arg = arg @flag = flag end |
Instance Attribute Details
#arg ⇒ Object
Returns the value of attribute arg.
5 6 7 |
# File 'lib/biblio/apa.rb', line 5 def arg @arg end |
#flag ⇒ Object
Returns the value of attribute flag.
5 6 7 |
# File 'lib/biblio/apa.rb', line 5 def flag @flag end |
#list ⇒ Object
Returns the value of attribute list.
5 6 7 |
# File 'lib/biblio/apa.rb', line 5 def list @list end |
Instance Method Details
#insertar(arg) ⇒ Object
18 19 20 21 |
# File 'lib/biblio/apa.rb', line 18 def insertar(arg) @list = List.new() @list.insert_multi(arg) end |
#to_s ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/biblio/apa.rb', line 24 def to_s if @flag == 1 i = 0 = "" if (@arg..count == 1) = "#{@arg.[i]}" else while i < @arg..count if i != @arg..count-1 = + "#{@arg.[i]} & " else = + "#{@arg.[i]}" end i= i + 1 end end "#{}. (#{@arg.date}). #{@arg.title} (#{@arg.edition}). #{@arg.editorial}" elsif @flag == 2 "#{@arg.}. (#{@arg.date}). #{@arg.title}. #{@arg.newspaper}, #{@arg.pages}" elsif @flag == 3 j = 0 = "" if (@arg..count == 1) = "#{@arg.[j]}" else while j < @arg..count if j != @arg..count-1 = + "#{@arg.[j]} & " else = + "#{@arg.[j]}" end j= j + 1 end end if @arg.url == " " and @arg.editione == " " "#{}. (#{@arg.date}). #{@arg.title} [#{@arg.type}]" elsif @arg.url == " " "#{}. (#{@arg.date}). #{@arg.title} (#{@arg.editione}). [#{@arg.type}]" elsif @arg.editione == " " "#{}. (#{@arg.date}). #{@arg.title} [#{@arg.type}] Disponible en: #{@arg.url} [#{@arg.date_access}]." else "#{}. (#{@arg.date}). #{@arg.title} (#{@arg.editione}). [#{@arg.type}] Disponible en: #{@arg.url} [#{@arg.date_access}]." end end end |