Class: SteamHldsLogParser::Displayer
- Inherits:
-
Object
- Object
- SteamHldsLogParser::Displayer
- Defined in:
- lib/steam_hlds_log_parser/displayer.rb
Overview
Default Displayer
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#display_data ⇒ Object
Display ‘data’.
-
#display_translation ⇒ Object
Display data translation.
-
#get_data ⇒ Hash
Return ‘data’.
-
#get_translation ⇒ String
Return ‘data’ translation.
-
#initialize(data) ⇒ Displayer
constructor
A new instance of Displayer.
Constructor Details
#initialize(data) ⇒ Displayer
Returns a new instance of Displayer.
11 12 13 |
# File 'lib/steam_hlds_log_parser/displayer.rb', line 11 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
9 10 11 |
# File 'lib/steam_hlds_log_parser/displayer.rb', line 9 def data @data end |
Instance Method Details
#display_data ⇒ Object
Display ‘data’
24 25 26 |
# File 'lib/steam_hlds_log_parser/displayer.rb', line 24 def display_data puts get_data end |
#display_translation ⇒ Object
Display data translation
37 38 39 |
# File 'lib/steam_hlds_log_parser/displayer.rb', line 37 def display_translation puts get_translation end |
#get_data ⇒ Hash
Return ‘data’
19 20 21 |
# File 'lib/steam_hlds_log_parser/displayer.rb', line 19 def get_data return @data end |
#get_translation ⇒ String
Return ‘data’ translation
32 33 34 |
# File 'lib/steam_hlds_log_parser/displayer.rb', line 32 def get_translation return I18n.t(@data[:type], @data[:params]) unless @data[:type].nil? end |