Class: CodebreakerVk::TableData

Inherits:
Object
  • Object
show all
Defined in:
lib/codebreaker_vk/table_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, difficulty:, attempts_total:, attempts_used:, hints_total:, hints_used:) ⇒ TableData

Returns a new instance of TableData.



7
8
9
10
11
12
13
14
# File 'lib/codebreaker_vk/table_data.rb', line 7

def initialize(name:, difficulty:, attempts_total:, attempts_used:, hints_total:, hints_used:)
  @name = name
  @difficulty = difficulty
  @attempts_total = attempts_total
  @attempts_used = attempts_used
  @hints_total = hints_total
  @hints_used = hints_used
end

Instance Attribute Details

#attempts_totalObject

Returns the value of attribute attempts_total.



5
6
7
# File 'lib/codebreaker_vk/table_data.rb', line 5

def attempts_total
  @attempts_total
end

#attempts_usedObject

Returns the value of attribute attempts_used.



5
6
7
# File 'lib/codebreaker_vk/table_data.rb', line 5

def attempts_used
  @attempts_used
end

#difficultyObject

Returns the value of attribute difficulty.



5
6
7
# File 'lib/codebreaker_vk/table_data.rb', line 5

def difficulty
  @difficulty
end

#hints_totalObject

Returns the value of attribute hints_total.



5
6
7
# File 'lib/codebreaker_vk/table_data.rb', line 5

def hints_total
  @hints_total
end

#hints_usedObject

Returns the value of attribute hints_used.



5
6
7
# File 'lib/codebreaker_vk/table_data.rb', line 5

def hints_used
  @hints_used
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/codebreaker_vk/table_data.rb', line 5

def name
  @name
end

Instance Method Details

#to_sObject



16
17
18
19
20
21
22
23
24
# File 'lib/codebreaker_vk/table_data.rb', line 16

def to_s
  I18n.t(:stats,
         name: @name,
         difficulty: @difficulty,
         attempts_total: @attempts_total,
         attempts_used: @attempts_used,
         hints_total: @hints_total,
         hints_used: @hints_used)
end