Class: Vedeu::Stream

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Stream

Returns a new instance of Stream.



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

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

Instance Method Details

#alignObject



27
28
29
# File 'lib/vedeu/models/stream.rb', line 27

def align
  @align ||= attributes[:align]
end

#attributesObject



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

def attributes
  defaults.merge!(@attributes)
end

#colourObject



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

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

#styleObject



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

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

#textObject



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

def text
  @text ||= attributes[:text]
end

#to_sObject



31
32
33
# File 'lib/vedeu/models/stream.rb', line 31

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

#widthObject



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

def width
  @width ||= attributes[:width]
end