Class: Vedeu::Stream
- Inherits:
-
Object
- Object
- Vedeu::Stream
- Defined in:
- lib/vedeu/models/stream.rb
Instance Method Summary collapse
- #align ⇒ Object
- #attributes ⇒ Object
- #colour ⇒ Object
-
#initialize(attributes = {}) ⇒ Stream
constructor
A new instance of Stream.
- #style ⇒ Object
- #text ⇒ Object
- #to_s ⇒ Object
- #width ⇒ Object
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
#align ⇒ Object
27 28 29 |
# File 'lib/vedeu/models/stream.rb', line 27 def align @align ||= attributes[:align] end |
#attributes ⇒ Object
7 8 9 |
# File 'lib/vedeu/models/stream.rb', line 7 def attributes defaults.merge!(@attributes) end |
#colour ⇒ Object
11 12 13 |
# File 'lib/vedeu/models/stream.rb', line 11 def colour @colour ||= Colour.new(attributes[:colour]) end |
#style ⇒ Object
15 16 17 |
# File 'lib/vedeu/models/stream.rb', line 15 def style @style ||= Attributes.coerce_styles(attributes[:style]) end |
#text ⇒ Object
19 20 21 |
# File 'lib/vedeu/models/stream.rb', line 19 def text @text ||= attributes[:text] end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/vedeu/models/stream.rb', line 31 def to_s [ colour, style, data ].join end |
#width ⇒ Object
23 24 25 |
# File 'lib/vedeu/models/stream.rb', line 23 def width @width ||= attributes[:width] end |