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