Class: COOKIE::C

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fortuneObject (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