Class: HowLongToBeat::HowLongToBeatEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/howlongtobeat/how_long_to_beat_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHowLongToBeatEntry

Returns a new instance of HowLongToBeatEntry.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 16

def initialize
  # Initialize with default values
  @game_id = -1
  @game_name = nil
  @game_alias = nil
  @game_type = nil
  @game_image_url = nil
  @game_web_link = nil
  @review_score = nil
  @profile_dev = nil
  @profile_platforms = nil
  @release_world = nil
  @similarity = -1
  @json_content = nil

  # Completion times
  @main_story = nil
  @main_extra = nil
  @completionist = nil
  @all_styles = nil
  @coop_time = nil
  @mp_time = nil

  # Complexity flags
  @complexity_lvl_combine = false
  @complexity_lvl_sp = false
  @complexity_lvl_co = false
  @complexity_lvl_mp = false
end

Instance Attribute Details

#all_stylesObject

Completion times



9
10
11
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 9

def all_styles
  @all_styles
end

#completionistObject

Completion times



9
10
11
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 9

def completionist
  @completionist
end

#complexity_lvl_coObject

Complexity flags



13
14
15
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 13

def complexity_lvl_co
  @complexity_lvl_co
end

#complexity_lvl_combineObject

Complexity flags



13
14
15
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 13

def complexity_lvl_combine
  @complexity_lvl_combine
end

#complexity_lvl_mpObject

Complexity flags



13
14
15
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 13

def complexity_lvl_mp
  @complexity_lvl_mp
end

#complexity_lvl_spObject

Complexity flags



13
14
15
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 13

def complexity_lvl_sp
  @complexity_lvl_sp
end

#coop_timeObject

Completion times



9
10
11
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 9

def coop_time
  @coop_time
end

#game_aliasObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def game_alias
  @game_alias
end

#game_idObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def game_id
  @game_id
end

#game_image_urlObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def game_image_url
  @game_image_url
end

#game_nameObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def game_name
  @game_name
end

#game_typeObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def game_type
  @game_type
end

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def game_web_link
  @game_web_link
end

#json_contentObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def json_content
  @json_content
end

#main_extraObject

Completion times



9
10
11
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 9

def main_extra
  @main_extra
end

#main_storyObject

Completion times



9
10
11
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 9

def main_story
  @main_story
end

#mp_timeObject

Completion times



9
10
11
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 9

def mp_time
  @mp_time
end

#profile_devObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def profile_dev
  @profile_dev
end

#profile_platformsObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def profile_platforms
  @profile_platforms
end

#release_worldObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def release_world
  @release_world
end

#review_scoreObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def review_score
  @review_score
end

#similarityObject

Base Game Details



4
5
6
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 4

def similarity
  @similarity
end

Instance Method Details

#to_sObject



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/howlongtobeat/how_long_to_beat_entry.rb', line 46

def to_s
  times = []
  times << "Main Story: #{main_story}h" if main_story
  times << "Main + Extra: #{main_extra}h" if main_extra
  times << "Completionist: #{completionist}h" if completionist
  times << "All Styles: #{all_styles}h" if all_styles
  times << "Co-op: #{coop_time}h" if coop_time
  times << "Multiplayer: #{mp_time}h" if mp_time

  "#{game_name} (ID: #{game_id}) - #{times.join(', ')}"
end