class SC2Cli::Subcommands::LadderShared::LadderDetailsMembership

Attributes

type[R]

Public Class Methods

new(json:) click to toggle source
# File lib/sc2cli/subcommands/ladder/ladderdetailsmembership.rb, line 27
def initialize(json:)
  @@console.fatal("Failed to get ladder membership details: game mode / type missing!") unless json.key?("localizedGameMode")

  type = json["localizedGameMode"]

  @@console.fatal("Failed to get ladder membership details: game mode / type is not a string!") unless type.kind_of?(String)
  @@console.fatal("Failed to get ladder membership details: game mode / type is blank!") if type.empty?

  @type = type
end

Public Instance Methods

to_s() click to toggle source
# File lib/sc2cli/subcommands/ladder/ladderdetailsmembership.rb, line 40
def to_s
  result = String.new

  result = "Type: #{@type}\n"

  return result
end