Class: COOKIE::C
- Inherits:
-
Object
- Object
- COOKIE::C
- Defined in:
- lib/toychest/cookie.rb
Instance Attribute Summary collapse
-
#fortune ⇒ Object
readonly
Returns the value of attribute fortune.
Instance Method Summary collapse
-
#initialize(k) ⇒ C
constructor
A new instance of C.
- #new! ⇒ Object
Constructor Details
#initialize(k) ⇒ C
Returns a new instance of C.
9 10 11 12 13 14 |
# File 'lib/toychest/cookie.rb', line 9 def initialize k @id = k if !@fortune new! end end |
Instance Attribute Details
#fortune ⇒ Object (readonly)
Returns the value of attribute fortune.
8 9 10 |
# File 'lib/toychest/cookie.rb', line 8 def fortune @fortune end |
Instance Method Details
#new! ⇒ Object
15 16 17 |
# File 'lib/toychest/cookie.rb', line 15 def new! @fortune = Co.get('/')['data']['message'] end |