Class: TextPlayer::Formatters::Json

Inherits:
Data
  • Object
show all
Defined in:
lib/text_player/formatters/json.rb

Overview

JSON formatter - returns JSON string of structured data

Constant Summary

Constants inherited from Data

Data::MOVES_PATTERN, Data::SCORE_PATTERN, Data::TIME_PATTERN

Instance Attribute Summary

Attributes inherited from Base

#command_result

Instance Method Summary collapse

Methods inherited from Data

#to_h

Methods inherited from Base

#initialize, #to_h, write, #write

Constructor Details

This class inherits a constructor from TextPlayer::Formatters::Base

Instance Method Details

#to_sObject



10
11
12
# File 'lib/text_player/formatters/json.rb', line 10

def to_s
  JSON.generate(to_h)
end