Class: ZODIAC::Z

Inherits:
Object
  • Object
show all
Defined in:
lib/toychest/zodiac.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(k) ⇒ Z

Returns a new instance of Z.



10
11
12
# File 'lib/toychest/zodiac.rb', line 10

def initialize k
	@id = k
end

Instance Attribute Details

#dailyObject (readonly)

Returns the value of attribute daily.



9
10
11
# File 'lib/toychest/zodiac.rb', line 9

def daily
  @daily
end

#monthlyObject (readonly)

Returns the value of attribute monthly.



9
10
11
# File 'lib/toychest/zodiac.rb', line 9

def monthly
  @monthly
end

#signObject (readonly)

Returns the value of attribute sign.



9
10
11
# File 'lib/toychest/zodiac.rb', line 9

def sign
  @sign
end

#weeklyObject (readonly)

Returns the value of attribute weekly.



9
10
11
# File 'lib/toychest/zodiac.rb', line 9

def weekly
  @weekly
end

Instance Method Details

#[](k) ⇒ Object



13
14
15
# File 'lib/toychest/zodiac.rb', line 13

def [] k
	run k
end

#daily!Object



23
24
25
# File 'lib/toychest/zodiac.rb', line 23

def daily!
	@daily = Zo.get("/api/v1/get-horoscope/daily?day=TODAY&sign=" + @sign)['data']['horoscope_data']
end

#monthly!Object



29
30
31
# File 'lib/toychest/zodiac.rb', line 29

def monthly!
	@monthly = Zo.get("/api/v1/get-horoscope/monthly?day=TODAY&sign=" + @sign)['data']['horoscope_data']
end

#run(s) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/toychest/zodiac.rb', line 16

def run s
	@sign = s
	daily!
	weekly!
	monthly!
	return { month: @monthly, week: @weekly, day: @daily }
end

#weekly!Object



26
27
28
# File 'lib/toychest/zodiac.rb', line 26

def weekly!
	@weekly = Zo.get("/api/v1/get-horoscope/weekly?day=TODAY&sign=" + @sign)['data']['horoscope_data']
end