vedeu 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/integrations/342_streams.rb +74 -0
  4. data/integrations/dsl_app_001.rb +58 -0
  5. data/integrations/dsl_app_002.rb +59 -0
  6. data/integrations/dsl_app_003.rb +58 -0
  7. data/integrations/dsl_app_004.rb +63 -0
  8. data/integrations/dsl_app_005.rb +62 -0
  9. data/integrations/dsl_app_006.rb +57 -0
  10. data/integrations/dsl_app_007.rb +63 -0
  11. data/integrations/dsl_app_008.rb +65 -0
  12. data/integrations/dsl_app_009.rb +70 -0
  13. data/integrations/dsl_app_010.rb +71 -0
  14. data/integrations/dsl_app_011.rb +61 -0
  15. data/integrations/dsl_app_012.rb +59 -0
  16. data/integrations/dsl_app_013.rb +60 -0
  17. data/integrations/dsl_app_014.rb +60 -0
  18. data/integrations/dsl_app_015.rb +60 -0
  19. data/integrations/dsl_app_016.rb +64 -0
  20. data/integrations/dsl_app_017.rb +56 -0
  21. data/integrations/dsl_app_018.rb +56 -0
  22. data/integrations/dsl_app_019.rb +56 -0
  23. data/integrations/dsl_app_020.rb +56 -0
  24. data/integrations/expected/342_streams.out +1 -0
  25. data/integrations/expected/dsl_app_001.out +1 -0
  26. data/integrations/expected/dsl_app_002.out +1 -0
  27. data/integrations/expected/dsl_app_003.out +1 -0
  28. data/integrations/expected/dsl_app_004.out +1 -0
  29. data/integrations/expected/dsl_app_005.out +1 -0
  30. data/integrations/expected/dsl_app_006.out +1 -0
  31. data/integrations/expected/dsl_app_007.out +1 -0
  32. data/integrations/expected/dsl_app_008.out +1 -0
  33. data/integrations/expected/dsl_app_009.out +1 -0
  34. data/integrations/expected/dsl_app_010.out +1 -0
  35. data/integrations/expected/dsl_app_011.out +1 -0
  36. data/integrations/expected/dsl_app_012.out +1 -0
  37. data/integrations/expected/dsl_app_013.out +1 -0
  38. data/integrations/expected/dsl_app_014.out +1 -0
  39. data/integrations/expected/dsl_app_015.out +1 -0
  40. data/integrations/expected/dsl_app_016.out +1 -0
  41. data/integrations/support/test_interface.rb +13 -0
  42. data/integrations/test_runner.sh +32 -0
  43. data/lib/vedeu/cells/empty.rb +14 -0
  44. data/lib/vedeu/colours/background.rb +13 -0
  45. data/lib/vedeu/colours/colour.rb +11 -4
  46. data/lib/vedeu/colours/foreground.rb +13 -0
  47. data/lib/vedeu/common.rb +42 -0
  48. data/lib/vedeu/dsl/attributes.rb +1 -1
  49. data/lib/vedeu/dsl/elements.rb +57 -23
  50. data/lib/vedeu/dsl/string/align.rb +17 -2
  51. data/lib/vedeu/geometries/position.rb +5 -0
  52. data/lib/vedeu/geometries/positionable.rb +2 -2
  53. data/lib/vedeu/presentation/style.rb +5 -0
  54. data/lib/vedeu/renderers/all.rb +1 -0
  55. data/lib/vedeu/renderers/escape.rb +96 -0
  56. data/lib/vedeu/repositories/defaults.rb +14 -6
  57. data/lib/vedeu/runtime/launcher.rb +5 -1
  58. data/lib/vedeu/version.rb +1 -1
  59. data/lib/vedeu/views/lines.rb +5 -0
  60. data/lib/vedeu/views/stream.rb +8 -1
  61. data/lib/vedeu/views/streams.rb +6 -1
  62. data/lib/vedeu/views/value.rb +2 -8
  63. data/lib/vedeu/views/view.rb +1 -1
  64. data/test/lib/vedeu/colours/colour_test.rb +0 -8
  65. data/test/lib/vedeu/common_test.rb +72 -0
  66. data/test/lib/vedeu/dsl/string/align_test.rb +1 -1
  67. metadata +43 -17
  68. data/examples/284_slow_rendering.rb +0 -108
  69. data/examples/views/expected/vedeu_line.html +0 -140
  70. data/examples/views/expected/vedeu_line.json +0 -96050
  71. data/examples/views/expected/vedeu_line.out +0 -1
  72. data/examples/views/expected/vedeu_line.txt +0 -58
  73. data/examples/views/expected/vedeu_lines.html +0 -140
  74. data/examples/views/expected/vedeu_lines.json +0 -96050
  75. data/examples/views/expected/vedeu_lines.out +0 -1
  76. data/examples/views/expected/vedeu_lines_alignment.html +0 -80
  77. data/examples/views/expected/vedeu_lines_alignment.json +0 -46370
  78. data/examples/views/expected/vedeu_lines_alignment.out +0 -1
  79. data/examples/views/line.rb +0 -128
  80. data/examples/views/lines.rb +0 -165
  81. data/examples/views/lines_alignment.rb +0 -126
  82. data/examples/views/runner.sh +0 -73
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(BMultiple `text` keywords with(0x(B(0x(Ba `stream` block view are    (0x(B(0x(Btreated as separate streams. (0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(BMultiple `stream` within a   (0x(B(0x(B`streams` within a `line`.   (0x(B(0x(B                             (0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(Bview->line (align: :left)    (0x(B(0x(B view->line (align: :centre) (0x(B(0x(B   view->line (align: :right)(0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(Bview->left                   (0x(B(0x(B        view->centre         (0x(B(0x(B                  view->right(0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(Bview->lines->left 1          (0x(B(0x(Bview->lines->left 2          (0x(B(0x(B                             (0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(B         view->lines->right 1(0x(B(0x(B         view->lines->right 2(0x(B(0x(B                             (0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(B    view->lines->centre 1    (0x(B(0x(B    view->lines->centre 2    (0x(B(0x(B                             (0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1 @@
1
+ (0l(B(0q(B Test (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(Bv->l->left        v->l->right(0x(B(0x(B         v->l->centre        (0x(B(0x(B                             (0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ Vedeu.interface :test_interface do
4
+ border do
5
+ title 'Test'
6
+ end
7
+ geometry do
8
+ x 2
9
+ y 2
10
+ xn 32
11
+ yn 6
12
+ end
13
+ end
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+
3
+ # Notes:
4
+ # At the moment, the terminal must be set to width 135 x height 34 for
5
+ # these tests to pass.
6
+
7
+ # die on error
8
+ set -e
9
+
10
+ # change to directory that contains this script
11
+ cd "$(dirname "$0")"
12
+
13
+ # Issue regression tests
14
+ ./342_streams.rb
15
+
16
+ # Integration tests
17
+ ./dsl_app_001.rb
18
+ ./dsl_app_002.rb
19
+ ./dsl_app_003.rb
20
+ ./dsl_app_004.rb
21
+ ./dsl_app_005.rb
22
+ ./dsl_app_006.rb
23
+ ./dsl_app_007.rb
24
+ ./dsl_app_008.rb
25
+ ./dsl_app_009.rb
26
+ ./dsl_app_010.rb
27
+ ./dsl_app_011.rb
28
+ ./dsl_app_012.rb
29
+ ./dsl_app_013.rb
30
+ ./dsl_app_014.rb
31
+ ./dsl_app_015.rb
32
+ ./dsl_app_016.rb
@@ -56,6 +56,20 @@ module Vedeu
56
56
  ' '
57
57
  end
58
58
 
59
+ # @return [String]
60
+ def to_ast
61
+ [
62
+ '[',
63
+ [
64
+ position.to_ast,
65
+ colour.to_ast,
66
+ style.to_ast,
67
+ ":#{type}",
68
+ ].reject(&:empty?).join(' '),
69
+ ']',
70
+ ].join
71
+ end
72
+
59
73
  # @return [Hash<Symbol => Hash<Symbol => String>, String>]
60
74
  def to_h
61
75
  {
@@ -17,6 +17,19 @@ module Vedeu
17
17
  present?(to_s)
18
18
  end
19
19
 
20
+ # @return [String]
21
+ def to_ast
22
+ return '' unless background?
23
+
24
+ if rgb?
25
+ ":bg_#{colour.to_s.slice(1..-1)}"
26
+
27
+ else
28
+ ':bg'
29
+
30
+ end
31
+ end
32
+
20
33
  # @return [Hash<Symbol => String>]
21
34
  def to_h
22
35
  {
@@ -74,7 +74,7 @@ module Vedeu
74
74
 
75
75
  # @return [Vedeu::Colours::Background]
76
76
  def background
77
- @_background ||= Vedeu::Colours::Background.coerce(@background)
77
+ Vedeu::Colours::Background.coerce(@background)
78
78
  end
79
79
 
80
80
  # Converts the value into a Vedeu::Colours::Background.
@@ -82,7 +82,7 @@ module Vedeu
82
82
  # @param value [String]
83
83
  # @return [Vedeu::Colours::Foreground]
84
84
  def background=(value)
85
- @_background = @background = Vedeu::Colours::Background.coerce(value)
85
+ @background = Vedeu::Colours::Background.coerce(value)
86
86
  end
87
87
 
88
88
  # An object is equal when its values are the same.
@@ -97,7 +97,7 @@ module Vedeu
97
97
 
98
98
  # @return [Vedeu::Colours::Foreground]
99
99
  def foreground
100
- @_foreground ||= Vedeu::Colours::Foreground.coerce(@foreground)
100
+ Vedeu::Colours::Foreground.coerce(@foreground)
101
101
  end
102
102
 
103
103
  # Converts the value into a Vedeu::Colours::Foreground.
@@ -105,7 +105,14 @@ module Vedeu
105
105
  # @param value [String]
106
106
  # @return [Vedeu::Colours::Foreground]
107
107
  def foreground=(value)
108
- @_foreground = @foreground = Vedeu::Colours::Foreground.coerce(value)
108
+ @foreground = Vedeu::Colours::Foreground.coerce(value)
109
+ end
110
+
111
+ # @return [String]
112
+ def to_ast
113
+ [foreground.to_ast, background.to_ast].reject do |value|
114
+ absent?(value)
115
+ end.join(' ')
109
116
  end
110
117
 
111
118
  # @return [Hash<Symbol => Hash<Symbol => String>>]
@@ -17,6 +17,19 @@ module Vedeu
17
17
  present?(to_s)
18
18
  end
19
19
 
20
+ # @return [String]
21
+ def to_ast
22
+ return '' unless foreground?
23
+
24
+ if rgb?
25
+ ":fg_#{colour.to_s.slice(1..-1)}"
26
+
27
+ else
28
+ ':fg'
29
+
30
+ end
31
+ end
32
+
20
33
  # @return [Hash<Symbol => String>]
21
34
  def to_h
22
35
  {
data/lib/vedeu/common.rb CHANGED
@@ -61,6 +61,20 @@ module Vedeu
61
61
  value.is_a?(Hash)
62
62
  end
63
63
 
64
+ # Returns a boolean indicating the model is a
65
+ # {Vedeu::Views::Line}.
66
+ #
67
+ # @return [Boolean]
68
+ def line_model?
69
+ if defined?(model)
70
+ model.is_a?(Vedeu::Views::Line)
71
+
72
+ else
73
+ false
74
+
75
+ end
76
+ end
77
+
64
78
  # Returns a boolean indicating whether the value is a Fixnum.
65
79
  #
66
80
  # @param value [Fixnum|void]
@@ -108,6 +122,20 @@ module Vedeu
108
122
  end.join('/')
109
123
  end
110
124
 
125
+ # Returns a boolean indicating the model is a
126
+ # {Vedeu::Views::Stream}.
127
+ #
128
+ # @return [Boolean]
129
+ def stream_model?
130
+ if defined?(model)
131
+ model.is_a?(Vedeu::Views::Stream)
132
+
133
+ else
134
+ false
135
+
136
+ end
137
+ end
138
+
111
139
  # Returns a boolean indicating whether the value is a Fixnum.
112
140
  #
113
141
  # @param value [String|void]
@@ -125,6 +153,20 @@ module Vedeu
125
153
  !falsy?(value)
126
154
  end
127
155
 
156
+ # Returns a boolean indicating the model is a
157
+ # {Vedeu::Views::View}.
158
+ #
159
+ # @return [Boolean]
160
+ def view_model?
161
+ if defined?(model)
162
+ model.is_a?(Vedeu::Views::View)
163
+
164
+ else
165
+ false
166
+
167
+ end
168
+ end
169
+
128
170
  end # Common
129
171
 
130
172
  end # Vedeu
@@ -181,7 +181,7 @@ module Vedeu
181
181
  if numeric?(options[:width])
182
182
  options[:width]
183
183
 
184
- elsif name
184
+ elsif view_model? && name
185
185
  geometry.bordered_width
186
186
 
187
187
  end
@@ -126,21 +126,64 @@ module Vedeu
126
126
  else
127
127
  s = Vedeu::Views::Stream.new(attrs)
128
128
  ss = Vedeu::Views::Streams.coerce([s])
129
-
130
129
  Vedeu::Views::Line.new(attrs.merge!(value: ss))
131
130
 
132
131
  end
133
132
 
134
- if view_model? || line_model?
133
+ if view_model?
135
134
  model.add(l)
136
135
 
136
+ elsif line_model?
137
+ model.add(l.value)
138
+
137
139
  else
138
140
  fail Vedeu::Error::Fatal,
139
141
  "Cannot add line to '#{model.class.name}' model."
140
142
 
141
143
  end
142
144
  end
143
- alias_method :stream, :line
145
+
146
+ # @param value [String] The value for the stream. Ignored when a
147
+ # block is given.
148
+ # @param opts [Hash]
149
+ # @option opts ... [void]
150
+ # @param block [Proc]
151
+ # @raise [Vedeu::Error::Fatal]
152
+ # @return [void]
153
+ def stream(value = '', opts = {}, &block)
154
+ requires_model!
155
+
156
+ attrs = Vedeu::DSL::Attributes.build(self, model, value, opts, &block)
157
+
158
+ l = if block_given?
159
+ if view_model?
160
+ Vedeu::Views::Line.build(attrs, &block)
161
+
162
+ else
163
+ Vedeu::Views::Stream.build(attrs, &block)
164
+
165
+ end
166
+
167
+ else
168
+ s = Vedeu::Views::Stream.new(attrs)
169
+ ss = Vedeu::Views::Streams.coerce([s])
170
+
171
+ Vedeu::Views::Line.new(attrs.merge!(value: ss))
172
+
173
+ end
174
+
175
+ if view_model?
176
+ model.add(l)
177
+
178
+ elsif line_model? || stream_model?
179
+ model.add([l])
180
+
181
+ else
182
+ fail Vedeu::Error::Fatal,
183
+ "Cannot add stream to '#{model.class.name}' model."
184
+
185
+ end
186
+ end
144
187
 
145
188
  # @todo This documentation needs editing. (GL: 2015-12-17)
146
189
  #
@@ -204,14 +247,21 @@ module Vedeu
204
247
  def text(value = '', opts = {})
205
248
  requires_model!
206
249
 
207
- if view_model? || line_model?
208
- attrs = Vedeu::DSL::Attributes.build(self, model, value, opts)
209
- s = Vedeu::Views::Stream.new(attrs)
210
- ss = Vedeu::Views::Streams.coerce([s])
250
+ attrs = Vedeu::DSL::Attributes.build(self, model, value, opts)
251
+ stream = Vedeu::Views::Stream.new(attrs)
252
+
253
+ if view_model?
254
+ ss = Vedeu::Views::Streams.coerce([stream])
211
255
  l = Vedeu::Views::Line.new(attrs.merge!(value: ss))
212
256
 
213
257
  model.add(l)
214
258
 
259
+ elsif line_model?
260
+ model.add(stream)
261
+
262
+ elsif stream_model?
263
+ model.add(stream.value)
264
+
215
265
  else
216
266
  fail Vedeu::Error::Fatal,
217
267
  "Cannot add text to '#{model.class.name}' model."
@@ -246,14 +296,6 @@ module Vedeu
246
296
 
247
297
  private
248
298
 
249
- # Returns a boolean indicating the model is a
250
- # {Vedeu::Views::Line}.
251
- #
252
- # @return [Boolean]
253
- def line_model?
254
- model.is_a?(Vedeu::Views::Line)
255
- end
256
-
257
299
  # @param block [Proc]
258
300
  # @macro raise_requires_block
259
301
  # @return [NilClass]
@@ -269,14 +311,6 @@ module Vedeu
269
311
  'No model, cannot continue.' unless present?(model)
270
312
  end
271
313
 
272
- # Returns a boolean indicating the model is a
273
- # {Vedeu::Views::View}.
274
- #
275
- # @return [Boolean]
276
- def view_model?
277
- model.is_a?(Vedeu::Views::View)
278
- end
279
-
280
314
  end # Elements
281
315
 
282
316
  end # DSL
@@ -91,7 +91,7 @@ module Vedeu
91
91
  @_geometry ||= Vedeu.geometries.by_name(options[:name])
92
92
  end
93
93
 
94
- # The value padded to width, left justified.
94
+ # The value padded to width, left justified. See {#width}.
95
95
  #
96
96
  # @return [String]
97
97
  def left
@@ -105,6 +105,15 @@ module Vedeu
105
105
  value.rjust(width, options[:pad])
106
106
  end
107
107
 
108
+ # Return the width given in the options. If no :width option was
109
+ # set, but a :name option was set, then we can use the width of
110
+ # the interface to determine the correct width to use. There is
111
+ # a caveat in this; if the :align option was set to :left, but
112
+ # no :width provided, then we don't want to use the interface's
113
+ # width. The reason being, is that there may be another stream
114
+ # in this line which will not appear by default as it will be
115
+ # push right out of the visible area.
116
+ #
108
117
  # Return the width of the interface when a name is given,
109
118
  # otherwise use the given width.
110
119
  #
@@ -114,7 +123,13 @@ module Vedeu
114
123
  options[:width]
115
124
 
116
125
  elsif present?(options[:name])
117
- geometry.bordered_width
126
+ if left_aligned?
127
+ value.size
128
+
129
+ else
130
+ geometry.bordered_width
131
+
132
+ end
118
133
 
119
134
  else
120
135
  value.size
@@ -98,6 +98,11 @@ module Vedeu
98
98
  [y, x]
99
99
  end
100
100
 
101
+ # @return [String]
102
+ def to_ast
103
+ ":y#{y}_x#{x}"
104
+ end
105
+
101
106
  # Return the position as a Hash.
102
107
  #
103
108
  # @return [Hash<Symbol => Fixnum|NilClass>]
@@ -14,7 +14,7 @@ module Vedeu
14
14
  #
15
15
  # @return [Vedeu::Geometries::Position]
16
16
  def position
17
- @_position ||= Vedeu::Geometries::Position.coerce(@position)
17
+ Vedeu::Geometries::Position.coerce(@position)
18
18
  end
19
19
 
20
20
  # Sets the position.
@@ -23,7 +23,7 @@ module Vedeu
23
23
  # Vedeu::Geometries::Position]
24
24
  # @return [Vedeu::Geometries::Position]
25
25
  def position=(value)
26
- @_position = @position = Vedeu::Geometries::Position.coerce(value)
26
+ @position = Vedeu::Geometries::Position.coerce(value)
27
27
  end
28
28
 
29
29
  # Returns a boolean indicating the position attribute of the