Class: Horoscopes::Zodiacs

Inherits:
Object
  • Object
show all
Defined in:
lib/horoscopes/zodiacs.rb

Constant Summary collapse

@@list =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#birthdayObject

Returns the value of attribute birthday.



2
3
4
# File 'lib/horoscopes/zodiacs.rb', line 2

def birthday
  @birthday
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/horoscopes/zodiacs.rb', line 2

def name
  @name
end

#numberObject

Returns the value of attribute number.



2
3
4
# File 'lib/horoscopes/zodiacs.rb', line 2

def number
  @number
end

#readingObject

Returns the value of attribute reading.



2
3
4
# File 'lib/horoscopes/zodiacs.rb', line 2

def reading
  @reading
end

Class Method Details

.allObject



5
6
7
# File 'lib/horoscopes/zodiacs.rb', line 5

def self.all
  @@list
end

.sort_by_nameObject



13
14
15
# File 'lib/horoscopes/zodiacs.rb', line 13

def self.sort_by_name
  @@list.sort_by {|sign| sign.name}
end

Instance Method Details

#saveObject



9
10
11
# File 'lib/horoscopes/zodiacs.rb', line 9

def save
  @@list << self
end