lib/vedeu/models/stream.rb in vedeu-0.0.32 vs lib/vedeu/models/stream.rb in vedeu-0.0.33
- old
+ new
@@ -1,30 +1,33 @@
+require 'json'
require 'virtus'
require_relative 'presentation'
require_relative '../support/terminal'
+require_relative 'style'
module Vedeu
class Stream
include Virtus.model
include Presentation
+ include Style
attribute :text, String, default: ''
def to_json
- Oj.dump(json_attributes, mode: :compat)
+ json_attributes.to_json
end
def to_s(options = {})
[colour, style, text].join
end
private
def json_attributes
{
- colour: colour.as_hash,
- style: style,
+ colour: colour,
+ style: style_original,
text: text
}
end
end
end