Class: Vedeu::Interface
- Inherits:
-
Object
- Object
- Vedeu::Interface
- Extended by:
- Forwardable
- Defined in:
- lib/vedeu/models/interface.rb
Direct Known Subclasses
Instance Method Summary collapse
- #attributes ⇒ Object
- #colour ⇒ Object
- #cursor ⇒ Object
- #delay ⇒ Object
- #geometry ⇒ Object
- #group ⇒ Object
-
#initialize(attributes = {}) ⇒ Interface
constructor
A new instance of Interface.
- #lines ⇒ Object
- #name ⇒ Object
- #style ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Interface
Returns a new instance of Interface.
9 10 11 |
# File 'lib/vedeu/models/interface.rb', line 9 def initialize(attributes = {}) @attributes = attributes end |
Instance Method Details
#attributes ⇒ Object
13 14 15 |
# File 'lib/vedeu/models/interface.rb', line 13 def attributes @_attributes ||= defaults.merge!(@attributes) end |
#colour ⇒ Object
29 30 31 |
# File 'lib/vedeu/models/interface.rb', line 29 def colour @colour ||= Colour.new(attributes[:colour]) end |
#cursor ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/vedeu/models/interface.rb', line 41 def cursor @cursor ||= if cursor? Esc.string('show_cursor') else Esc.string('hide_cursor') end end |
#delay ⇒ Object
51 52 53 |
# File 'lib/vedeu/models/interface.rb', line 51 def delay @delay || attributes[:delay] end |
#geometry ⇒ Object
37 38 39 |
# File 'lib/vedeu/models/interface.rb', line 37 def geometry @geometry ||= Geometry.new(attributes[:geometry]) end |
#group ⇒ Object
21 22 23 |
# File 'lib/vedeu/models/interface.rb', line 21 def group @group ||= attributes[:group] end |
#lines ⇒ Object
25 26 27 |
# File 'lib/vedeu/models/interface.rb', line 25 def lines @lines ||= Attributes.coercer(attributes[:lines], Line, :streams) end |
#name ⇒ Object
17 18 19 |
# File 'lib/vedeu/models/interface.rb', line 17 def name @name ||= attributes[:name] end |
#style ⇒ Object
33 34 35 |
# File 'lib/vedeu/models/interface.rb', line 33 def style @style ||= Attributes.coerce_styles(attributes[:style]) end |
#to_s ⇒ Object
55 56 57 |
# File 'lib/vedeu/models/interface.rb', line 55 def to_s Render.call(self) end |