Class: Bibliography
Direct Known Subclasses
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#date ⇒ Object
Returns the value of attribute date.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(autor, title, date, editorial) ⇒ Bibliography
constructor
A new instance of Bibliography.
Constructor Details
#initialize(autor, title, date, editorial) ⇒ Bibliography
Returns a new instance of Bibliography.
9 10 11 12 13 |
# File 'lib/biblio/biblio.rb', line 9 def initialize (autor,title,date,editorial) @author = autor @title = title @date = date end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
5 6 7 |
# File 'lib/biblio/biblio.rb', line 5 def @author end |
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/biblio/biblio.rb', line 5 def date @date end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/biblio/biblio.rb', line 5 def title @title end |
Instance Method Details
#<=>(other) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/biblio/biblio.rb', line 15 def <=>(other) if (@author != other.) @author <=> other. elsif(@date != other.date) @date <=> other.date else @title <=> other.title end end |
#==(other) ⇒ Object
27 28 29 30 31 |
# File 'lib/biblio/biblio.rb', line 27 def ==(other) @title == other.title end |