Class: Snafu::Models::Giant

Inherits:
Object
  • Object
show all
Defined in:
lib/snafu/models/giant.rb

Overview

Defines a class for Glitch Giants

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Giant

Returns a new instance of Giant.



11
12
13
14
15
16
17
# File 'lib/snafu/models/giant.rb', line 11

def initialize(options={})
  @name = options[:name] || options["name"]
  @cur_favor = (options[:cur_favor] || options["cur_favor"] || 0).to_i
  @max_favor = (options[:max_favor] || options["max_favor"] || 0).to_i
  @cur_daily_favor = (options[:cur_daily_favor] || options["cur_daily_favor"] || 0).to_i
  @max_daily_favor = (options[:max_daily_favor] || options["max_daily_favor"] || 0).to_i
end

Instance Attribute Details

#cur_daily_favorObject (readonly) Also known as: current_daily_favor

Returns the value of attribute cur_daily_favor.



6
7
8
# File 'lib/snafu/models/giant.rb', line 6

def cur_daily_favor
  @cur_daily_favor
end

#cur_favorObject (readonly) Also known as: current_favor

Returns the value of attribute cur_favor.



6
7
8
# File 'lib/snafu/models/giant.rb', line 6

def cur_favor
  @cur_favor
end

#max_daily_favorObject (readonly)

Returns the value of attribute max_daily_favor.



6
7
8
# File 'lib/snafu/models/giant.rb', line 6

def max_daily_favor
  @max_daily_favor
end

#max_favorObject (readonly)

Returns the value of attribute max_favor.



6
7
8
# File 'lib/snafu/models/giant.rb', line 6

def max_favor
  @max_favor
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/snafu/models/giant.rb', line 6

def name
  @name
end