Class: Reference
Direct Known Subclasses
Instance Attribute Summary collapse
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#date ⇒ Object
Returns the value of attribute date.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #get_title ⇒ Object
-
#initialize(authors, title, date) ⇒ Reference
constructor
A new instance of Reference.
Constructor Details
#initialize(authors, title, date) ⇒ Reference
Returns a new instance of Reference.
6 7 8 9 10 11 12 13 |
# File 'lib/prct11/reference.rb', line 6 def initialize(, title, date) self. = [] .each do |palabras| @authors.push(palabras) end @title = title @date = date end |
Instance Attribute Details
#authors ⇒ Object
Returns the value of attribute authors.
3 4 5 |
# File 'lib/prct11/reference.rb', line 3 def @authors end |
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/prct11/reference.rb', line 3 def date @date end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/prct11/reference.rb', line 3 def title @title end |
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/prct11/reference.rb', line 19 def <=>(other) return nil unless other.is_a? Reference if == other. then if date == other.date title <=> other.title else date <=> other.date end else <=> other. end end |
#get_title ⇒ Object
15 16 17 |
# File 'lib/prct11/reference.rb', line 15 def get_title @title end |