Class: RShade::Formatter::Trace::Json
- Defined in:
- lib/rshade/formatter/trace/json.rb
Instance Attribute Summary collapse
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
-
#pretty ⇒ Object
readonly
Returns the value of attribute pretty.
Instance Method Summary collapse
- #call(event_store) ⇒ Object
-
#initialize(filepath:, pretty: false) ⇒ Json
constructor
A new instance of Json.
Constructor Details
#initialize(filepath:, pretty: false) ⇒ Json
Returns a new instance of Json.
9 10 11 12 |
# File 'lib/rshade/formatter/trace/json.rb', line 9 def initialize(filepath:, pretty: false) @filepath = filepath @pretty = pretty end |
Instance Attribute Details
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
7 8 9 |
# File 'lib/rshade/formatter/trace/json.rb', line 7 def filepath @filepath end |
#pretty ⇒ Object (readonly)
Returns the value of attribute pretty.
7 8 9 |
# File 'lib/rshade/formatter/trace/json.rb', line 7 def pretty @pretty end |
Instance Method Details
#call(event_store) ⇒ Object
15 16 17 18 19 |
# File 'lib/rshade/formatter/trace/json.rb', line 15 def call(event_store) ::File.open(filepath, 'a+') do |file| file.puts(convert_to_json(flat(event_store), pretty)) end end |