lib/triviacrack/user.rb in triviacrack-0.6.0 vs lib/triviacrack/user.rb in triviacrack-0.7.0
- old
+ new
@@ -1,10 +1,11 @@
+# frozen_string_literal: true
+
# Public: An object representing a Trivia Crack User, including information
# about the user's level, lives and coins.
module TriviaCrack
class User
-
# Public: The unique identifier of the user.
attr_reader :id
# Public: The unique username of the user.
attr_reader :username
@@ -49,11 +50,11 @@
attr_reader :goal_points
# Public: Boolean indicating whether the user has leveled up.
attr_reader :level_up
- def initialize(id:, username: nil, facebook_id: nil, facebook_name: nil,
+ def initialize(id:, username: nil, facebook_id: nil, facebook_name: nil, # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists
coins: nil, lives: nil, max_lives: nil, unlimited_lives: nil,
country: nil, extra_shots: nil, level: nil,
level_points: nil, level_progress: nil, goal_points: nil,
level_up: nil)
@id = id
@@ -84,8 +85,7 @@
#
# Returns true if the user can start a new game, false otherwise.
def start_new_game?
@lives >= 1 || @unlimited_lives
end
-
end
end