vedeu 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/docs/dsl.md +3 -3
  3. data/examples/borders_app.rb +2 -0
  4. data/examples/colours_app.rb +2 -0
  5. data/examples/configuration_app.rb +2 -0
  6. data/examples/drb_app.rb +2 -0
  7. data/examples/focus_app.rb +2 -0
  8. data/examples/hello_world.rb +2 -0
  9. data/examples/material_colours_app.rb +2 -0
  10. data/lib/vedeu.rb +2 -0
  11. data/lib/vedeu/all.rb +4 -13
  12. data/lib/vedeu/api.rb +7 -6
  13. data/lib/vedeu/borders/border.rb +1 -1
  14. data/lib/vedeu/borders/render_border.rb +18 -18
  15. data/lib/vedeu/buffers/buffer.rb +18 -28
  16. data/lib/vedeu/colours/colour.rb +1 -1
  17. data/lib/vedeu/colours/colour_translator.rb +1 -1
  18. data/lib/vedeu/cursor/cursor.rb +9 -6
  19. data/lib/vedeu/dsl/border.rb +1 -1
  20. data/lib/vedeu/dsl/composition.rb +5 -5
  21. data/lib/vedeu/dsl/geometry.rb +1 -1
  22. data/lib/vedeu/dsl/group.rb +1 -1
  23. data/lib/vedeu/dsl/interface.rb +69 -93
  24. data/lib/vedeu/dsl/keymap.rb +1 -1
  25. data/lib/vedeu/dsl/line.rb +11 -11
  26. data/lib/vedeu/dsl/shared.rb +81 -0
  27. data/lib/vedeu/dsl/stream.rb +3 -3
  28. data/lib/vedeu/dsl/view.rb +76 -64
  29. data/lib/vedeu/models/escape.rb +1 -1
  30. data/lib/vedeu/models/interface.rb +3 -57
  31. data/lib/vedeu/models/menu.rb +1 -1
  32. data/lib/vedeu/models/views/all.rb +22 -0
  33. data/lib/vedeu/models/views/char.rb +175 -0
  34. data/lib/vedeu/models/views/chars.rb +13 -0
  35. data/lib/vedeu/models/views/composition.rb +73 -0
  36. data/lib/vedeu/models/views/line.rb +111 -0
  37. data/lib/vedeu/models/views/lines.rb +13 -0
  38. data/lib/vedeu/models/views/stream.rb +122 -0
  39. data/lib/vedeu/models/views/streams.rb +13 -0
  40. data/lib/vedeu/models/views/view.rb +157 -0
  41. data/lib/vedeu/models/views/view_collection.rb +13 -0
  42. data/lib/vedeu/null/view.rb +67 -0
  43. data/lib/vedeu/output/clear/named_interface.rb +4 -4
  44. data/lib/vedeu/output/compressor.rb +6 -6
  45. data/lib/vedeu/output/html_char.rb +6 -6
  46. data/lib/vedeu/output/output.rb +3 -3
  47. data/lib/vedeu/output/presentation.rb +1 -1
  48. data/lib/vedeu/output/renderers/escape_sequence.rb +1 -1
  49. data/lib/vedeu/output/renderers/file.rb +1 -1
  50. data/lib/vedeu/output/renderers/html.rb +3 -3
  51. data/lib/vedeu/output/renderers/json.rb +4 -4
  52. data/lib/vedeu/output/renderers/null.rb +1 -1
  53. data/lib/vedeu/output/renderers/terminal.rb +5 -5
  54. data/lib/vedeu/output/renderers/text.rb +3 -3
  55. data/lib/vedeu/output/style.rb +1 -1
  56. data/lib/vedeu/output/text.rb +20 -15
  57. data/lib/vedeu/output/viewport.rb +16 -23
  58. data/lib/vedeu/output/virtual_buffer.rb +9 -8
  59. data/lib/vedeu/output/virtual_terminal.rb +11 -11
  60. data/lib/vedeu/output/wordwrap.rb +5 -5
  61. data/lib/vedeu/runtime/application.rb +1 -1
  62. data/lib/vedeu/runtime/main_loop.rb +1 -1
  63. data/lib/vedeu/templating/helpers.rb +11 -10
  64. data/lib/vedeu/templating/template.rb +1 -1
  65. data/lib/vedeu/templating/view_template.rb +6 -6
  66. data/lib/vedeu/version.rb +1 -2
  67. data/test/lib/vedeu/api_test.rb +30 -30
  68. data/test/lib/vedeu/buffers/buffer_test.rb +5 -139
  69. data/test/lib/vedeu/colours/colour_translator_test.rb +3 -3
  70. data/test/lib/vedeu/configuration/api_test.rb +3 -3
  71. data/test/lib/vedeu/cursor/refresh_cursor_test.rb +1 -1
  72. data/test/lib/vedeu/dsl/composition_test.rb +7 -7
  73. data/test/lib/vedeu/dsl/group_test.rb +2 -2
  74. data/test/lib/vedeu/dsl/interface_test.rb +31 -21
  75. data/test/lib/vedeu/dsl/keymap_test.rb +4 -4
  76. data/test/lib/vedeu/dsl/line_test.rb +8 -8
  77. data/test/lib/vedeu/dsl/stream_test.rb +4 -4
  78. data/test/lib/vedeu/dsl/text_test.rb +11 -11
  79. data/test/lib/vedeu/dsl/view_test.rb +24 -29
  80. data/test/lib/vedeu/geometry/grid_test.rb +4 -4
  81. data/test/lib/vedeu/input/key_test.rb +1 -1
  82. data/test/lib/vedeu/internal_api_test.rb +18 -18
  83. data/test/lib/vedeu/models/focus_test.rb +54 -54
  84. data/test/lib/vedeu/models/interface_test.rb +11 -105
  85. data/test/lib/vedeu/models/menu_test.rb +1 -1
  86. data/test/lib/vedeu/models/views/char_test.rb +257 -0
  87. data/test/lib/vedeu/models/views/chars_test.rb +22 -0
  88. data/test/lib/vedeu/models/views/composition_test.rb +61 -0
  89. data/test/lib/vedeu/models/views/line_test.rb +189 -0
  90. data/test/lib/vedeu/models/views/lines_test.rb +22 -0
  91. data/test/lib/vedeu/models/views/stream_test.rb +138 -0
  92. data/test/lib/vedeu/models/views/streams_test.rb +22 -0
  93. data/test/lib/vedeu/models/views/view_test.rb +40 -0
  94. data/test/lib/vedeu/null/view_test.rb +12 -0
  95. data/test/lib/vedeu/output/clear/named_interface_test.rb +4 -4
  96. data/test/lib/vedeu/output/compressor_test.rb +28 -28
  97. data/test/lib/vedeu/output/html_char_test.rb +2 -2
  98. data/test/lib/vedeu/output/presentation_test.rb +10 -14
  99. data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +20 -4
  100. data/test/lib/vedeu/output/renderers/html_test.rb +4 -4
  101. data/test/lib/vedeu/output/renderers/json_test.rb +3 -3
  102. data/test/lib/vedeu/output/text_test.rb +10 -10
  103. data/test/lib/vedeu/output/viewport_test.rb +21 -23
  104. data/test/lib/vedeu/output/virtual_buffer_test.rb +1 -1
  105. data/test/lib/vedeu/output/virtual_terminal_test.rb +1 -1
  106. data/test/lib/vedeu/output/wordwrap_test.rb +9 -9
  107. data/test/lib/vedeu/repositories/repository_test.rb +2 -2
  108. data/test/lib/vedeu/templating/helpers_test.rb +6 -39
  109. data/test/lib/vedeu/templating/template_test.rb +2 -2
  110. data/test/lib/vedeu/templating/view_template_test.rb +91 -91
  111. data/test/lib/vedeu/terminal_test.rb +1 -1
  112. metadata +33 -27
  113. data/lib/vedeu/buffers/display_buffer.rb +0 -39
  114. data/lib/vedeu/models/char.rb +0 -170
  115. data/lib/vedeu/models/chars.rb +0 -9
  116. data/lib/vedeu/models/composition.rb +0 -66
  117. data/lib/vedeu/models/line.rb +0 -112
  118. data/lib/vedeu/models/lines.rb +0 -9
  119. data/lib/vedeu/models/stream.rb +0 -122
  120. data/lib/vedeu/models/streams.rb +0 -9
  121. data/test/lib/vedeu/buffers/display_buffer_test.rb +0 -61
  122. data/test/lib/vedeu/models/char_test.rb +0 -253
  123. data/test/lib/vedeu/models/chars_test.rb +0 -18
  124. data/test/lib/vedeu/models/composition_test.rb +0 -57
  125. data/test/lib/vedeu/models/line_test.rb +0 -189
  126. data/test/lib/vedeu/models/lines_test.rb +0 -18
  127. data/test/lib/vedeu/models/stream_test.rb +0 -141
  128. data/test/lib/vedeu/models/streams_test.rb +0 -18
@@ -27,7 +27,7 @@ module Vedeu
27
27
 
28
28
  # An object is equal when its values are the same.
29
29
  #
30
- # @param other [Vedeu::Char]
30
+ # @param other [Vedeu::Views::Char]
31
31
  # @return [Boolean]
32
32
  def eql?(other)
33
33
  self.class == other.class && value == other.value
@@ -1,19 +1,14 @@
1
1
  module Vedeu
2
2
 
3
3
  # An Interface represents a portion of the terminal defined by
4
- # {Vedeu::Geometry}. It is a container for {Vedeu::Line} and {Vedeu::Stream}
5
- # objects.
4
+ # {Vedeu::Geometry}.
6
5
  #
7
6
  class Interface
8
7
 
9
8
  include Vedeu::Model
10
9
  include Vedeu::Presentation
11
- include Vedeu::DisplayBuffer
12
10
  include Vedeu::Toggleable
13
11
 
14
- collection Vedeu::Lines
15
- member Vedeu::Line
16
-
17
12
  # @!attribute [rw] client
18
13
  # @return [Fixnum|Float]
19
14
  attr_accessor :client
@@ -31,7 +26,7 @@ module Vedeu
31
26
  attr_accessor :name
32
27
 
33
28
  # @!attribute [rw] parent
34
- # @return [Vedeu::Composition]
29
+ # @return [Vedeu::Views::Composition]
35
30
  attr_accessor :parent
36
31
 
37
32
  # @!attribute [rw] zindex
@@ -42,10 +37,6 @@ module Vedeu
42
37
  # @return [Hash]
43
38
  attr_reader :attributes
44
39
 
45
- # @!attribute [w] lines
46
- # @return [Array<Vedeu::Line>]
47
- attr_writer :lines
48
-
49
40
  # Return a new instance of Vedeu::Interface.
50
41
  #
51
42
  # @param attributes [Hash]
@@ -53,9 +44,8 @@ module Vedeu
53
44
  # @option attributes colour [Vedeu::Colour]
54
45
  # @option attributes delay [Float]
55
46
  # @option attributes group [String]
56
- # @option attributes lines [Vedeu::Lines]
57
47
  # @option attributes name [String]
58
- # @option attributes parent [Vedeu::Composition]
48
+ # @option attributes parent [Vedeu::Views::Composition]
59
49
  # @option attributes repository [Vedeu::Interfaces]
60
50
  # @option attributes style [Vedeu::Style]
61
51
  # @option attributes visible [Boolean]
@@ -67,13 +57,6 @@ module Vedeu
67
57
  @attributes.each { |key, value| instance_variable_set("@#{key}", value) }
68
58
  end
69
59
 
70
- # @param child [Vedeu::Line]
71
- # @return [void]
72
- def add(child)
73
- @lines = lines.add(child)
74
- end
75
- alias_method :<<, :add
76
-
77
60
  # Hide a named interface buffer, or without a name, the buffer of the
78
61
  # currently focussed interface.
79
62
  #
@@ -99,42 +82,6 @@ module Vedeu
99
82
  '>'
100
83
  end
101
84
 
102
- # @return [Vedeu::Lines]
103
- def lines
104
- collection.coerce(@lines, self)
105
- end
106
- alias_method :value, :lines
107
-
108
- # Returns a boolean indicating whether the interface has content.
109
- #
110
- # @return [Boolean]
111
- def lines?
112
- lines.any?
113
- end
114
-
115
- # Returns a boolean indicating whether the interface belongs to a
116
- # group.
117
- #
118
- # @return [Boolean]
119
- def group?
120
- !group.nil? && !group.empty?
121
- end
122
-
123
- # @return [Array<Array<Vedeu::Char>>]
124
- def render
125
- return [] unless visible?
126
-
127
- output = [
128
- Vedeu.trigger(:_hide_cursor_, name),
129
- Vedeu::Clear::NamedInterface.render(name),
130
- Vedeu::Viewport.render(self),
131
- Vedeu.borders.by_name(name).render,
132
- Vedeu.trigger(:_show_cursor_, name)
133
- ]
134
-
135
- output
136
- end
137
-
138
85
  # Show the named interface buffer, or without a name, the buffer of the
139
86
  # currently focussed interface.
140
87
  #
@@ -160,7 +107,6 @@ module Vedeu
160
107
  foreground: :default),
161
108
  delay: 0.0,
162
109
  group: '',
163
- lines: [],
164
110
  name: '',
165
111
  parent: nil,
166
112
  repository: Vedeu.interfaces,
@@ -54,7 +54,7 @@ module Vedeu
54
54
  def self.menu(name = '', &block)
55
55
  fail Vedeu::InvalidSyntax, 'block not given' unless block_given?
56
56
 
57
- build({ name: name }, &block).store
57
+ build(name: name, &block).store
58
58
  end
59
59
 
60
60
  # Returns a new instance of Vedeu::Menu.
@@ -0,0 +1,22 @@
1
+ module Vedeu
2
+
3
+ # View related models.
4
+ #
5
+ module Views
6
+
7
+ end # Views
8
+
9
+ end # Vedeu
10
+
11
+ require 'vedeu/models/interface_collection'
12
+ require 'vedeu/models/views/char'
13
+ require 'vedeu/models/views/chars'
14
+ require 'vedeu/models/views/stream'
15
+ require 'vedeu/models/views/streams'
16
+ require 'vedeu/models/views/line'
17
+ require 'vedeu/models/views/lines'
18
+ require 'vedeu/models/interface'
19
+ require 'vedeu/models/interfaces'
20
+ require 'vedeu/models/views/view_collection'
21
+ require 'vedeu/models/views/view'
22
+ require 'vedeu/models/views/composition'
@@ -0,0 +1,175 @@
1
+ module Vedeu
2
+
3
+ module Views
4
+
5
+ # A Char represents a single character of the terminal. It is a container
6
+ # for the a single character in a {Vedeu::Views::Stream}.
7
+ #
8
+ # Though a multi-character String can be passed as a value, only the first
9
+ # character is returned in the escape sequence.
10
+ #
11
+ class Char
12
+
13
+ include Comparable
14
+ include Vedeu::Presentation
15
+
16
+ # @!attribute [rw] border
17
+ # @return [NilClass|Symbol]
18
+ attr_accessor :border
19
+
20
+ # @!attribute [rw] parent
21
+ # @return [Vedeu::Views::Line]
22
+ attr_accessor :parent
23
+
24
+ # @!attribute [r] attributes
25
+ # @return [Hash]
26
+ attr_reader :attributes
27
+
28
+ # @!attribute [r] position
29
+ # @return [Vedeu::Position]
30
+ attr_reader :position
31
+
32
+ # @!attribute [w] value
33
+ # @return [String]
34
+ attr_writer :value
35
+
36
+ # Returns a new instance of Vedeu::Views::Char.
37
+ #
38
+ # @param attributes [Hash]
39
+ # @option attributes value [String]
40
+ # @option attributes parent [Vedeu::Views::Line]
41
+ # @option attributes colour [Vedeu::Colour]
42
+ # @option attributes style [Vedeu::Style]
43
+ # @option attributes position [Vedeu::Position]
44
+ # @option attributes border [NilClass|Symbol] A symbol representing the
45
+ # border 'piece' this Vedeu::Views::Char represents.
46
+ # @return [Vedeu::Views::Char]
47
+ def initialize(attributes = {})
48
+ @attributes = attributes
49
+ @border = @attributes[:border]
50
+ @parent = @attributes[:parent]
51
+ @value = @attributes[:value]
52
+ end
53
+
54
+ # When {Vedeu::Viewport#show} has less lines that required to fill
55
+ # the visible area of the interface, it creates a line that contains a
56
+ # single {Vedeu::Views::Char} containing a space (0x20); later, attempts
57
+ # to call `#chars` on an expected {Vedeu::Views::Line} and fail; this
58
+ # method fixes that.
59
+ #
60
+ # @return [Array]
61
+ def chars
62
+ []
63
+ end
64
+
65
+ # An object is equal when its values are the same.
66
+ #
67
+ # @param other [Vedeu::Views::Char]
68
+ # @return [Boolean]
69
+ def eql?(other)
70
+ self.class == other.class && value == other.value &&
71
+ position == other.position
72
+ end
73
+ alias_method :==, :eql?
74
+
75
+ # Override Ruby's Object#inspect method to provide a more helpful output.
76
+ #
77
+ # @return [String]
78
+ def inspect
79
+ "<Vedeu::Views::Char '#{Vedeu::Esc.escape(to_s)}'>"
80
+ end
81
+
82
+ # @return [Vedeu::Position]
83
+ def position
84
+ @position = Vedeu::Position.coerce(@attributes[:position])
85
+ end
86
+
87
+ # Sets the position of the Vedeu::Views::Char.
88
+ #
89
+ # @param value [Vedeu::Position]
90
+ # @return [Vedeu::Position]
91
+ def position=(value)
92
+ @position = @attributes[:position] = Vedeu::Position.coerce(value)
93
+ end
94
+
95
+ # @return [String]
96
+ def value
97
+ if border
98
+ Vedeu::Esc.border { @value }
99
+
100
+ else
101
+ @value
102
+
103
+ end
104
+ end
105
+
106
+ # Returns the x position for the Vedeu::Views::Char when set.
107
+ #
108
+ # @return [Fixnum|NilClass]
109
+ def x
110
+ position.x if position
111
+ end
112
+
113
+ # Returns the y position for the Vedeu::Views::Char when set.
114
+ #
115
+ # @return [Fixnum|NilClass]
116
+ def y
117
+ position.y if position
118
+ end
119
+
120
+ # Returns a Hash of all the values before coercion.
121
+ #
122
+ # @note
123
+ # From this hash we should be able to construct a new instance of
124
+ # Vedeu::Views::Char, however, at the moment, `:parent` cannot be
125
+ # coerced.
126
+ #
127
+ # @return [Hash]
128
+ def to_hash
129
+ {
130
+ border: border.to_s,
131
+ colour: colour_to_hash,
132
+ parent: parent_to_hash,
133
+ position: position_to_hash,
134
+ style: style.to_s,
135
+ value: value,
136
+ }
137
+ end
138
+
139
+ # @return [String]
140
+ def to_html
141
+ @to_html ||= Vedeu::HTMLChar.render(self)
142
+ end
143
+
144
+ private
145
+
146
+ # @return [Hash]
147
+ def colour_to_hash
148
+ {
149
+ background: background.to_s,
150
+ foreground: foreground.to_s,
151
+ }
152
+ end
153
+
154
+ # @return [Hash]
155
+ def parent_to_hash
156
+ {
157
+ background: parent_background.to_s,
158
+ foreground: parent_foreground.to_s,
159
+ style: parent_style.to_s,
160
+ }
161
+ end
162
+
163
+ # @return [Hash]
164
+ def position_to_hash
165
+ {
166
+ y: y,
167
+ x: x,
168
+ }
169
+ end
170
+
171
+ end # Char
172
+
173
+ end # Views
174
+
175
+ end # Vedeu
@@ -0,0 +1,13 @@
1
+ module Vedeu
2
+
3
+ module Views
4
+
5
+ # A collection of {Vedeu::Views::Char} instances.
6
+ #
7
+ class Chars < Vedeu::Collection
8
+
9
+ end # Chars
10
+
11
+ end # Views
12
+
13
+ end # Vedeu
@@ -0,0 +1,73 @@
1
+ module Vedeu
2
+
3
+ module Views
4
+
5
+ # A composition is a collection of interfaces.
6
+ #
7
+ class Composition
8
+
9
+ include Vedeu::Model
10
+ include Vedeu::Presentation
11
+
12
+ collection Vedeu::Views::ViewCollection
13
+ member Vedeu::Views::View
14
+
15
+ # @!attribute [r] attributes
16
+ # @return [Hash]
17
+ attr_reader :attributes
18
+
19
+ # Returns a new instance of Vedeu::Views::Composition.
20
+ #
21
+ # @param attributes [Hash]
22
+ # @option attributes client [void]
23
+ # @option attributes colour [Vedeu::Colour]
24
+ # @option attributes views [void]
25
+ # @option attributes repository [void]
26
+ # @option attributes style [Vedeu::Style]
27
+ # @return [Vedeu::Views::Composition]
28
+ def initialize(attributes = {})
29
+ @attributes = defaults.merge!(attributes)
30
+
31
+ @attributes.each do |key, value|
32
+ instance_variable_set("@#{key}", value)
33
+ end
34
+ end
35
+
36
+ # @param child [Vedeu::Views::View]
37
+ # @return [Vedeu::InterfaceCollection]
38
+ def add(child)
39
+ @views = collection.coerce(@views, self).add(child)
40
+ end
41
+
42
+ # @return [Vedeu::Views::Views]
43
+ def views
44
+ collection.coerce(@views, self)
45
+ end
46
+ alias_method :value, :views
47
+
48
+ # Composition objects do not have a parent.
49
+ #
50
+ # @return [NilClass]
51
+ def parent
52
+ nil
53
+ end
54
+
55
+ private
56
+
57
+ # The default values for a new instance of this class.
58
+ #
59
+ # @return [Hash]
60
+ def defaults
61
+ {
62
+ client: nil,
63
+ colour: nil,
64
+ views: [],
65
+ style: nil,
66
+ }
67
+ end
68
+
69
+ end # Composition
70
+
71
+ end # Views
72
+
73
+ end # Vedeu
@@ -0,0 +1,111 @@
1
+ module Vedeu
2
+
3
+ module Views
4
+
5
+ # Represents a single row of the terminal. It is a container for
6
+ # {Vedeu::Views::Stream} objects. A line's width is determined by the
7
+ # {Vedeu::Geometry} it belongs to.
8
+ #
9
+ class Line
10
+
11
+ include Vedeu::Model
12
+ include Vedeu::Presentation
13
+
14
+ collection Vedeu::Views::Streams
15
+ member Vedeu::Views::Stream
16
+
17
+ # @!attribute [rw] parent
18
+ # @return [Vedeu::Views::View]
19
+ attr_accessor :parent
20
+
21
+ # @!attribute [r] attributes
22
+ # @return [Hash]
23
+ attr_reader :attributes
24
+
25
+ # Returns a new instance of Vedeu::Views::Line.
26
+ #
27
+ # @param attributes [Hash]
28
+ # @option attributes streams [Vedeu::Views::Streams]
29
+ # @option attributes parent [Vedeu::Views::View]
30
+ # @option attributes colour [Vedeu::Colour]
31
+ # @option attributes style [Vedeu::Style]
32
+ # @return [Vedeu::Views::Line]
33
+ def initialize(attributes = {})
34
+ @attributes = defaults.merge!(attributes)
35
+
36
+ @attributes.each do |key, value|
37
+ instance_variable_set("@#{key}", value)
38
+ end
39
+ end
40
+
41
+ # @param child [void]
42
+ # @return [void]
43
+ def add(child)
44
+ @_streams = @streams = collection.coerce(streams, self).add(child)
45
+ end
46
+ alias_method :<<, :add
47
+
48
+ # Returns an array of all the characters with formatting for this line.
49
+ #
50
+ # @return [Array]
51
+ # @see Vedeu::Views::Stream
52
+ def chars
53
+ return [] if empty?
54
+
55
+ @chars ||= streams.flat_map(&:chars)
56
+ end
57
+
58
+ # Returns a boolean indicating whether the line has content.
59
+ #
60
+ # @return [Boolean]
61
+ def empty?
62
+ streams.empty?
63
+ end
64
+
65
+ # An object is equal when its values are the same.
66
+ #
67
+ # @param other [Vedeu::Collection]
68
+ # @return [Boolean]
69
+ def eql?(other)
70
+ self.class == other.class && streams == other.streams
71
+ end
72
+ alias_method :==, :eql?
73
+
74
+ # @return [NilClass|String]
75
+ def name
76
+ parent.name if parent
77
+ end
78
+
79
+ # Returns the size of the content in characters without formatting.
80
+ #
81
+ # @return [Fixnum]
82
+ def size
83
+ streams.map(&:size).inject(0, :+)
84
+ end
85
+
86
+ # @return [Vedeu::Views::Streams]
87
+ def streams
88
+ @_streams ||= collection.coerce(@streams, self)
89
+ end
90
+ alias_method :value, :streams
91
+
92
+ private
93
+
94
+ # The default values for a new instance of this class.
95
+ #
96
+ # @return [Hash]
97
+ def defaults
98
+ {
99
+ client: nil,
100
+ colour: nil,
101
+ parent: nil,
102
+ streams: [],
103
+ style: nil,
104
+ }
105
+ end
106
+
107
+ end # Line
108
+
109
+ end # Views
110
+
111
+ end # Vedeu