vedeu 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/docs/dsl.md +4 -4
- data/lib/vedeu/all.rb +6 -18
- data/lib/vedeu/api.rb +14 -13
- data/lib/vedeu/bindings/system.rb +5 -4
- data/lib/vedeu/buffers/virtual_buffer.rb +13 -11
- data/lib/vedeu/configuration/api.rb +4 -3
- data/lib/vedeu/cursors/cursor.rb +23 -18
- data/lib/vedeu/distributed/client.rb +11 -6
- data/lib/vedeu/distributed/server.rb +4 -3
- data/lib/vedeu/dsl/keymap.rb +6 -6
- data/lib/vedeu/editor/all.rb +19 -0
- data/lib/vedeu/{input/editor → editor}/capture.rb +1 -1
- data/lib/vedeu/{input/editor → editor}/cropper.rb +0 -0
- data/lib/vedeu/{input/editor → editor}/cursor.rb +0 -0
- data/lib/vedeu/{input/editor → editor}/document.rb +0 -0
- data/lib/vedeu/{input/editor → editor}/documents.rb +0 -0
- data/lib/vedeu/{input/editor → editor}/editor.rb +0 -0
- data/lib/vedeu/{input/editor → editor}/insert.rb +0 -0
- data/lib/vedeu/{input/editor → editor}/line.rb +0 -0
- data/lib/vedeu/{input/editor → editor}/lines.rb +0 -0
- data/lib/vedeu/error.rb +21 -18
- data/lib/vedeu/esc/borders.rb +6 -4
- data/lib/vedeu/esc/colours.rb +13 -12
- data/lib/vedeu/esc/esc.rb +11 -10
- data/lib/vedeu/input/all.rb +15 -0
- data/lib/vedeu/input/input.rb +55 -52
- data/lib/vedeu/input/key.rb +36 -30
- data/lib/vedeu/input/keymap.rb +101 -92
- data/lib/vedeu/input/keymaps.rb +10 -6
- data/lib/vedeu/input/keys.rb +8 -4
- data/lib/vedeu/input/mapper.rb +125 -121
- data/lib/vedeu/input/translator.rb +159 -0
- data/lib/vedeu/internal_api.rb +16 -15
- data/lib/vedeu/logging/all.rb +13 -0
- data/lib/vedeu/logging/debug.rb +84 -0
- data/lib/vedeu/logging/lockless_log_device.rb +65 -0
- data/lib/vedeu/logging/log.rb +179 -0
- data/lib/vedeu/logging/mono_logger.rb +26 -0
- data/lib/vedeu/logging/timer.rb +68 -0
- data/lib/vedeu/menus/all.rb +12 -0
- data/lib/vedeu/{dsl/menu.rb → menus/dsl.rb} +19 -18
- data/lib/vedeu/menus/menu.rb +234 -0
- data/lib/vedeu/{null/menu.rb → menus/null.rb} +6 -6
- data/lib/vedeu/menus/repository.rb +18 -0
- data/lib/vedeu/models/cell.rb +62 -55
- data/lib/vedeu/models/escape.rb +55 -50
- data/lib/vedeu/models/page.rb +74 -69
- data/lib/vedeu/models/row.rb +55 -51
- data/lib/vedeu/models/views/all.rb +1 -0
- data/lib/vedeu/models/views/char.rb +1 -1
- data/lib/vedeu/models/views/html_char.rb +165 -0
- data/lib/vedeu/output/renderers/html.rb +5 -4
- data/lib/vedeu/repositories/model.rb +2 -0
- data/lib/vedeu/runtime/application.rb +110 -103
- data/lib/vedeu/runtime/bootstrap.rb +109 -103
- data/lib/vedeu/runtime/flags.rb +45 -41
- data/lib/vedeu/runtime/launcher.rb +1 -1
- data/lib/vedeu/runtime/main_loop.rb +51 -46
- data/lib/vedeu/runtime/traps.rb +20 -16
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu.rb +2 -2
- data/test/lib/vedeu/buffers/virtual_buffer_test.rb +1 -1
- data/test/lib/vedeu/cursors/cursor_test.rb +11 -5
- data/test/lib/vedeu/dsl/interface_test.rb +1 -1
- data/test/lib/vedeu/dsl/keymap_test.rb +2 -2
- data/test/lib/vedeu/{input/editor → editor}/capture_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/cropper_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/cursor_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/document_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/documents_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/editor_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/insert_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/line_test.rb +0 -0
- data/test/lib/vedeu/{input/editor → editor}/lines_test.rb +0 -0
- data/test/lib/vedeu/input/input_test.rb +58 -54
- data/test/lib/vedeu/input/key_test.rb +29 -25
- data/test/lib/vedeu/input/keymap_test.rb +74 -70
- data/test/lib/vedeu/input/keymaps_test.rb +8 -4
- data/test/lib/vedeu/input/keys_test.rb +12 -8
- data/test/lib/vedeu/input/mapper_test.rb +64 -56
- data/test/lib/vedeu/input/translator_test.rb +36 -0
- data/test/lib/vedeu/logging/debug_test.rb +39 -0
- data/test/lib/vedeu/logging/lockless_log_device_test.rb +42 -0
- data/test/lib/vedeu/logging/log_test.rb +52 -0
- data/test/lib/vedeu/logging/mono_logger_test.rb +43 -0
- data/test/lib/vedeu/logging/timer_test.rb +44 -0
- data/test/lib/vedeu/{dsl/menu_test.rb → menus/dsl_test.rb} +6 -6
- data/test/lib/vedeu/menus/menu_test.rb +305 -0
- data/test/lib/vedeu/{null/menu_test.rb → menus/null_test.rb} +5 -5
- data/test/lib/vedeu/menus/repository_test.rb +17 -0
- data/test/lib/vedeu/models/cell_test.rb +54 -50
- data/test/lib/vedeu/models/escape_test.rb +49 -45
- data/test/lib/vedeu/models/page_test.rb +167 -160
- data/test/lib/vedeu/models/row_test.rb +71 -67
- data/test/lib/vedeu/models/views/html_char_test.rb +110 -0
- data/test/lib/vedeu/output/compressor_test.rb +44 -22
- data/test/lib/vedeu/output/renderers_test.rb +4 -2
- data/test/lib/vedeu/runtime/application_test.rb +36 -32
- data/test/lib/vedeu/runtime/bootstrap_test.rb +31 -26
- data/test/lib/vedeu/runtime/flags_test.rb +33 -29
- data/test/lib/vedeu/runtime/launcher_test.rb +4 -2
- data/test/lib/vedeu/runtime/main_loop_test.rb +28 -24
- data/test/lib/vedeu/runtime/traps_test.rb +8 -4
- data/test/test_helper.rb +4 -2
- metadata +66 -63
- data/lib/vedeu/input/editor/all.rb +0 -19
- data/lib/vedeu/input/input_translator.rb +0 -155
- data/lib/vedeu/log/debug.rb +0 -79
- data/lib/vedeu/log/lockless_log_device.rb +0 -61
- data/lib/vedeu/log/log.rb +0 -172
- data/lib/vedeu/log/mono_logger.rb +0 -21
- data/lib/vedeu/log/timer.rb +0 -63
- data/lib/vedeu/models/menu.rb +0 -217
- data/lib/vedeu/models/menus.rb +0 -14
- data/lib/vedeu/output/html_char.rb +0 -161
- data/test/lib/vedeu/input/input_translator_test.rb +0 -32
- data/test/lib/vedeu/log/debug_test.rb +0 -35
- data/test/lib/vedeu/log/lockless_log_device_test.rb +0 -29
- data/test/lib/vedeu/log/log_test.rb +0 -48
- data/test/lib/vedeu/log/mono_logger_test.rb +0 -31
- data/test/lib/vedeu/log/timer_test.rb +0 -40
- data/test/lib/vedeu/models/menu_test.rb +0 -301
- data/test/lib/vedeu/models/menus_test.rb +0 -13
- data/test/lib/vedeu/output/html_char_test.rb +0 -106
data/lib/vedeu/models/cell.rb
CHANGED
@@ -1,70 +1,77 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
class Cell
|
3
|
+
module Models
|
6
4
|
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
5
|
+
# A Cell represents a single square of the terminal.
|
6
|
+
#
|
7
|
+
class Cell
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
# @!attribute [r] colour
|
10
|
+
# @return [NilClass|String]
|
11
|
+
attr_reader :colour
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
# @!attribute [r] style
|
14
|
+
# @return [NilClass|Array<Symbol|String>|Symbol|String]
|
15
|
+
attr_reader :style
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
# @!attribute [r] value
|
18
|
+
# @return [NilClass|String]
|
19
|
+
attr_reader :value
|
22
20
|
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
# @!attribute [r] x
|
22
|
+
# @return [NilClass|Fixnum]
|
23
|
+
attr_reader :x
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
# Fixnum, String, Symbol]
|
31
|
-
# @option attributes colour [NilClass|String]
|
32
|
-
# @option attributes style [NilClass|Array<Symbol|String>|Symbol|String]
|
33
|
-
# @option attributes value [NilClass|String]
|
34
|
-
# @option attributes x [NilClass|Fixnum]
|
35
|
-
# @option attributes y [NilClass|Fixnum]
|
36
|
-
# @return [Vedeu::Cell]
|
37
|
-
def initialize(attributes = {})
|
38
|
-
@attributes = defaults.merge!(attributes)
|
25
|
+
# @!attribute [r] y
|
26
|
+
# @return [NilClass|Fixnum]
|
27
|
+
attr_reader :y
|
39
28
|
|
40
|
-
|
41
|
-
|
29
|
+
# Returns a new instance of Vedeu::Models::Cell.
|
30
|
+
#
|
31
|
+
# @param attributes [Hash<Symbol => Array<Symbol|String>,
|
32
|
+
# Fixnum, String, Symbol]
|
33
|
+
# @option attributes colour [NilClass|String]
|
34
|
+
# @option attributes style
|
35
|
+
# [NilClass|Array<Symbol|String>|Symbol|String]
|
36
|
+
# @option attributes value [NilClass|String]
|
37
|
+
# @option attributes x [NilClass|Fixnum]
|
38
|
+
# @option attributes y [NilClass|Fixnum]
|
39
|
+
# @return [Vedeu::Models::Cell]
|
40
|
+
def initialize(attributes = {})
|
41
|
+
@attributes = defaults.merge!(attributes)
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
def eql?(other)
|
48
|
-
self.class == other.class && value == other.value && x == other.x &&
|
49
|
-
y == other.y
|
50
|
-
end
|
51
|
-
alias_method :==, :eql?
|
43
|
+
@attributes.each do |key, value|
|
44
|
+
instance_variable_set("@#{key}", value)
|
45
|
+
end
|
46
|
+
end
|
52
47
|
|
53
|
-
|
48
|
+
# An object is equal when its values are the same.
|
49
|
+
#
|
50
|
+
# @param other [Vedeu::Models::Cell]
|
51
|
+
# @return [Boolean]
|
52
|
+
def eql?(other)
|
53
|
+
self.class == other.class && value == other.value && x == other.x &&
|
54
|
+
y == other.y
|
55
|
+
end
|
56
|
+
alias_method :==, :eql?
|
54
57
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
private
|
59
|
+
|
60
|
+
# Returns the default options/attributes for this class.
|
61
|
+
#
|
62
|
+
# @return [Hash<Symbol => void>]
|
63
|
+
def defaults
|
64
|
+
{
|
65
|
+
colour: nil,
|
66
|
+
style: nil,
|
67
|
+
value: nil,
|
68
|
+
x: nil,
|
69
|
+
y: nil,
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
end # Cell
|
67
74
|
|
68
|
-
end #
|
75
|
+
end # Models
|
69
76
|
|
70
77
|
end # Vedeu
|
data/lib/vedeu/models/escape.rb
CHANGED
@@ -1,64 +1,69 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
class Escape
|
3
|
+
module Models
|
6
4
|
|
7
|
-
#
|
8
|
-
# @return [String]
|
9
|
-
attr_reader :value
|
10
|
-
|
11
|
-
# Returns a new instance of Vedeu::Escape.
|
5
|
+
# Represents an invisible escape character sequence.
|
12
6
|
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
class Escape
|
8
|
+
|
9
|
+
# @!attribute [r] value
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :value
|
12
|
+
|
13
|
+
# Returns a new instance of Vedeu::Models::Escape.
|
14
|
+
#
|
15
|
+
# @param attributes [String]
|
16
|
+
# @option attributes position
|
17
|
+
# [Vedeu::Geometry::Position|Array<Fixnum>]
|
18
|
+
# @option attributes value [String]
|
19
|
+
# @return [Vedeu::Models::Escape]
|
20
|
+
def initialize(attributes = {})
|
21
|
+
defaults.merge!(attributes).each do |key, value|
|
22
|
+
instance_variable_set("@#{key}", value)
|
23
|
+
end
|
20
24
|
end
|
21
|
-
end
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
# @return [NilClass]
|
27
|
+
def null
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
alias_method :background, :null
|
31
|
+
alias_method :colour, :null
|
32
|
+
alias_method :foreground, :null
|
33
|
+
alias_method :style, :null
|
31
34
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
# An object is equal when its values are the same.
|
36
|
+
#
|
37
|
+
# @param other [Vedeu::Views::Char]
|
38
|
+
# @return [Boolean]
|
39
|
+
def eql?(other)
|
40
|
+
self.class == other.class && value == other.value
|
41
|
+
end
|
42
|
+
alias_method :==, :eql?
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
44
|
+
# @return [String]
|
45
|
+
def position
|
46
|
+
Vedeu::Geometry::Position.coerce(@position)
|
47
|
+
end
|
45
48
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
# @return [String]
|
50
|
+
def to_s
|
51
|
+
"#{position}#{value}"
|
52
|
+
end
|
53
|
+
alias_method :to_str, :to_s
|
51
54
|
|
52
|
-
|
55
|
+
private
|
56
|
+
|
57
|
+
# @return [Hash]
|
58
|
+
def defaults
|
59
|
+
{
|
60
|
+
position: [1, 1],
|
61
|
+
value: '',
|
62
|
+
}
|
63
|
+
end
|
53
64
|
|
54
|
-
#
|
55
|
-
def defaults
|
56
|
-
{
|
57
|
-
position: [1, 1],
|
58
|
-
value: '',
|
59
|
-
}
|
60
|
-
end
|
65
|
+
end # Escape
|
61
66
|
|
62
|
-
end #
|
67
|
+
end # Models
|
63
68
|
|
64
69
|
end # Vedeu
|
data/lib/vedeu/models/page.rb
CHANGED
@@ -1,89 +1,94 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
class Page
|
3
|
+
module Models
|
6
4
|
|
7
|
-
|
5
|
+
# A Page represents an array of Vedeu::Models::Row objects.
|
6
|
+
#
|
7
|
+
class Page
|
8
|
+
|
9
|
+
include Enumerable
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
# @!attribute [r] rows
|
12
|
+
# @return [Array<NilClass|Vedeu::Models::Row>]
|
13
|
+
attr_reader :rows
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
value
|
15
|
+
# @param value
|
16
|
+
# [Vedeu::Models::Page|Vedeu::Models::Row|Array<void>|void]
|
17
|
+
# @return [Vedeu::Models::Page]
|
18
|
+
def self.coerce(value)
|
19
|
+
if value.is_a?(Vedeu::Models::Page)
|
20
|
+
value
|
18
21
|
|
19
|
-
|
20
|
-
|
22
|
+
elsif value.is_a?(Vedeu::Models::Row)
|
23
|
+
Vedeu::Models::Page.new([value])
|
21
24
|
|
22
|
-
|
23
|
-
|
25
|
+
elsif value.is_a?(Array) && value.empty?
|
26
|
+
Vedeu::Models::Page.new([Vedeu::Models::Row.coerce(value)])
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
elsif value.is_a?(Array)
|
29
|
+
values = value.map do |v|
|
30
|
+
if v.is_a?(Vedeu::Models::Row)
|
31
|
+
v
|
29
32
|
|
30
|
-
|
31
|
-
|
33
|
+
else
|
34
|
+
Vedeu::Models::Row.coerce(v)
|
32
35
|
|
36
|
+
end
|
33
37
|
end
|
38
|
+
Vedeu::Models::Page.new(values)
|
39
|
+
|
40
|
+
else
|
41
|
+
fail Vedeu::Error::InvalidSyntax,
|
42
|
+
'Cannot coerce as value is not an Array.'
|
43
|
+
|
34
44
|
end
|
35
|
-
|
45
|
+
end
|
36
46
|
|
37
|
-
|
38
|
-
|
39
|
-
|
47
|
+
# Returns an instance of Vedeu::Models::Page.
|
48
|
+
#
|
49
|
+
# @param rows [Array<NilClass|Vedeu::Models::Row>]
|
50
|
+
# @return [Vedeu::Models::Page]
|
51
|
+
def initialize(rows = [])
|
52
|
+
@rows = rows || []
|
53
|
+
end
|
40
54
|
|
55
|
+
# Provides iteration over the collection.
|
56
|
+
#
|
57
|
+
# @param block [Proc]
|
58
|
+
# @return [Enumerator]
|
59
|
+
def each(&block)
|
60
|
+
rows.each(&block)
|
41
61
|
end
|
42
|
-
end
|
43
62
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
63
|
+
# An object is equal when its values are the same.
|
64
|
+
#
|
65
|
+
# @param other [Vedeu::Models::Page]
|
66
|
+
# @return [Boolean]
|
67
|
+
def eql?(other)
|
68
|
+
self.class == other.class && rows == other.rows
|
69
|
+
end
|
70
|
+
alias_method :==, :eql?
|
51
71
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
def each(&block)
|
57
|
-
rows.each(&block)
|
58
|
-
end
|
72
|
+
# @param index [Fixnum]
|
73
|
+
# @return [NilClass|Vedeu::Models::Row]
|
74
|
+
def row(index = nil)
|
75
|
+
return nil if index.nil?
|
59
76
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
# @param row_index [Fixnum]
|
78
|
-
# @param cell_index [Fixnum]
|
79
|
-
# @return [NilClass|void]
|
80
|
-
def cell(row_index = nil, cell_index = nil)
|
81
|
-
return nil if row_index.nil? || cell_index.nil?
|
82
|
-
return nil unless row(row_index)
|
83
|
-
|
84
|
-
row(row_index)[cell_index]
|
85
|
-
end
|
86
|
-
|
87
|
-
end # Page
|
77
|
+
rows[index]
|
78
|
+
end
|
79
|
+
|
80
|
+
# @param row_index [Fixnum]
|
81
|
+
# @param cell_index [Fixnum]
|
82
|
+
# @return [NilClass|void]
|
83
|
+
def cell(row_index = nil, cell_index = nil)
|
84
|
+
return nil if row_index.nil? || cell_index.nil?
|
85
|
+
return nil unless row(row_index)
|
86
|
+
|
87
|
+
row(row_index)[cell_index]
|
88
|
+
end
|
89
|
+
|
90
|
+
end # Page
|
91
|
+
|
92
|
+
end # Models
|
88
93
|
|
89
94
|
end # Vedeu
|
data/lib/vedeu/models/row.rb
CHANGED
@@ -1,66 +1,70 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
class Row
|
3
|
+
module Models
|
6
4
|
|
7
|
-
|
5
|
+
# A Row represents an array of Vedeu::Models::Cell objects.
|
6
|
+
#
|
7
|
+
class Row
|
8
|
+
|
9
|
+
include Enumerable
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
# @!attribute [r] cells
|
12
|
+
# @return [Array<NilClass|void>]
|
13
|
+
attr_reader :cells
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
# @param value [Vedeu::Models::Row|Array<void>|void]
|
16
|
+
# @return [Vedeu::Models::Row]
|
17
|
+
def self.coerce(value)
|
18
|
+
if value.is_a?(self)
|
19
|
+
value
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
+
elsif value.is_a?(Array)
|
22
|
+
new(value.compact)
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
+
elsif value.nil?
|
25
|
+
new
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
+
else
|
28
|
+
new([value])
|
27
29
|
|
30
|
+
end
|
28
31
|
end
|
29
|
-
end
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
# Returns an instance of Vedeu::Models::Row.
|
34
|
+
#
|
35
|
+
# @param cells [Array<NilClass|void>]
|
36
|
+
# @return [Vedeu::Models::Row]
|
37
|
+
def initialize(cells = [])
|
38
|
+
@cells = cells || []
|
39
|
+
end
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
# Provides iteration over the collection.
|
42
|
+
#
|
43
|
+
# @param block [Proc]
|
44
|
+
# @return [Enumerator]
|
45
|
+
def each(&block)
|
46
|
+
cells.each(&block)
|
47
|
+
end
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
49
|
+
# An object is equal when its values are the same.
|
50
|
+
#
|
51
|
+
# @param other [Vedeu::Models::Row]
|
52
|
+
# @return [Boolean]
|
53
|
+
def eql?(other)
|
54
|
+
self.class == other.class && cells == other.cells
|
55
|
+
end
|
56
|
+
alias_method :==, :eql?
|
57
|
+
|
58
|
+
# @param index [Fixnum]
|
59
|
+
# @return [NilClass|void]
|
60
|
+
def cell(index)
|
61
|
+
return nil if index.nil?
|
62
|
+
|
63
|
+
cells[index]
|
64
|
+
end
|
65
|
+
|
66
|
+
end # Row
|
67
|
+
|
68
|
+
end # Models
|
65
69
|
|
66
70
|
end # Vedeu
|