Class: SC2Cli::Subcommands::LadderShared::LadderDetails
- Inherits:
-
Object
- Object
- SC2Cli::Subcommands::LadderShared::LadderDetails
- Defined in:
- lib/sc2cli/subcommands/ladder/ladderdetails.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#membership ⇒ Object
readonly
Returns the value of attribute membership.
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
-
#initialize(id:, api:, player:) ⇒ LadderDetails
constructor
A new instance of LadderDetails.
- #to_s ⇒ Object
Constructor Details
#initialize(id:, api:, player:) ⇒ LadderDetails
Returns a new instance of LadderDetails.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/sc2cli/subcommands/ladder/ladderdetails.rb', line 40 def initialize(id:, api:, player:) @@console.fatal("Cannot find ladder details for ladder with an ID that is not an integer!") unless id.kind_of?(Integer) @@console.fatal("Cannot find ladder details for ladder with an ID that is not valid!") unless id > 0 @id = id @player = player @region = api.region lookup(api: api) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
32 33 34 |
# File 'lib/sc2cli/subcommands/ladder/ladderdetails.rb', line 32 def id @id end |
#membership ⇒ Object (readonly)
Returns the value of attribute membership.
33 34 35 |
# File 'lib/sc2cli/subcommands/ladder/ladderdetails.rb', line 33 def membership @membership end |
#player ⇒ Object (readonly)
Returns the value of attribute player.
34 35 36 |
# File 'lib/sc2cli/subcommands/ladder/ladderdetails.rb', line 34 def player @player end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
35 36 37 |
# File 'lib/sc2cli/subcommands/ladder/ladderdetails.rb', line 35 def rank @rank end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
36 37 38 |
# File 'lib/sc2cli/subcommands/ladder/ladderdetails.rb', line 36 def region @region end |
Instance Method Details
#to_s ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/sc2cli/subcommands/ladder/ladderdetails.rb', line 53 def to_s result = String.new result += "-------------------------------------------------------------------------------\n" result += @membership.to_s result += "-------------------------------------------------------------------------------\n" result += @teams.with_member(player: @player).to_s result += "Ranks/Pools for this player:\n" result += @rank.to_s return result end |