Class: ZODIAC::Z
- Inherits:
-
Object
- Object
- ZODIAC::Z
- Defined in:
- lib/toychest/zodiac.rb
Instance Attribute Summary collapse
-
#daily ⇒ Object
readonly
Returns the value of attribute daily.
-
#monthly ⇒ Object
readonly
Returns the value of attribute monthly.
-
#sign ⇒ Object
readonly
Returns the value of attribute sign.
-
#weekly ⇒ Object
readonly
Returns the value of attribute weekly.
Instance Method Summary collapse
- #[](k) ⇒ Object
- #daily! ⇒ Object
-
#initialize(k) ⇒ Z
constructor
A new instance of Z.
- #monthly! ⇒ Object
- #run(s) ⇒ Object
- #weekly! ⇒ Object
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
#daily ⇒ Object (readonly)
Returns the value of attribute daily.
9 10 11 |
# File 'lib/toychest/zodiac.rb', line 9 def daily @daily end |
#monthly ⇒ Object (readonly)
Returns the value of attribute monthly.
9 10 11 |
# File 'lib/toychest/zodiac.rb', line 9 def monthly @monthly end |
#sign ⇒ Object (readonly)
Returns the value of attribute sign.
9 10 11 |
# File 'lib/toychest/zodiac.rb', line 9 def sign @sign end |
#weekly ⇒ Object (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 |