Class: Vedeu::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/models/line.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Line

Returns a new instance of Line.



3
4
5
# File 'lib/vedeu/models/line.rb', line 3

def initialize(attributes = {})
  @attributes = attributes
end

Instance Method Details

#attributesObject



7
8
9
# File 'lib/vedeu/models/line.rb', line 7

def attributes
  defaults.merge!(@attributes)
end

#colourObject



11
12
13
# File 'lib/vedeu/models/line.rb', line 11

def colour
  @colour ||= Colour.new(attributes[:colour])
end

#streamsObject



15
16
17
# File 'lib/vedeu/models/line.rb', line 15

def streams
  @streams ||= Attributes.coercer(attributes[:streams], Stream, :text)
end

#styleObject



19
20
21
# File 'lib/vedeu/models/line.rb', line 19

def style
  @style ||= Attributes.coerce_styles(attributes[:style])
end

#to_sObject



23
24
25
# File 'lib/vedeu/models/line.rb', line 23

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