Sha256: 285b761e03de636346fa72dc5dcc1c80f9c63c112ebb7b536d5fa637cb5f2402

Contents?: true

Size: 523 Bytes

Versions: 3

Compression:

Stored size: 523 Bytes

Contents

require 'oj'
require 'virtus'

require_relative 'presentation'
require_relative 'stream_collection'

module Vedeu
  class Line
    include Virtus.model
    include Presentation

    attribute :model,   Hash
    attribute :streams, StreamCollection

    def to_json
      Oj.dump(json_attributes, mode: :compat)
    end

    def to_s
      [colour, style, streams].join
    end

    private

    def json_attributes
      {
        colour:  colour,
        style:   style,
        streams: streams
      }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vedeu-0.0.32 lib/vedeu/models/line.rb
vedeu-0.0.31 lib/vedeu/models/line.rb
vedeu-0.0.30 lib/vedeu/models/line.rb