abnf-parser 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/abnf/parser/node.rb +16 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6efd77fe5445b9d0188ebd6fca3ffa3cb7fb1a45
|
4
|
+
data.tar.gz: 04ab61c5fbe7a83c7ad048bc1b4a6b6024abcda2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1008455aa5be7a1aa6728382c101b17826e4e24f0bb43a83634113f71c85eacb9bbefd38bc21a7457e5868e780d70c08f5a29c962f26f52fa2fe41ea050a2dcc
|
7
|
+
data.tar.gz: ea4709b7e916a0dc96c1a67d1a5e575b5709cdb2b0c313983fd9d6733d8e35d125b6a40ec5a26d92ca37aefdd550df2a40a6cef9f9eb8c65562b0f3c29f2f691
|
data/lib/abnf/parser/node.rb
CHANGED
@@ -28,6 +28,22 @@ module ABNF
|
|
28
28
|
self.text == other_node.text and self.abnf == other_node.abnf
|
29
29
|
end
|
30
30
|
|
31
|
+
def [] index
|
32
|
+
children[index]
|
33
|
+
end
|
34
|
+
|
35
|
+
def children
|
36
|
+
[]
|
37
|
+
end
|
38
|
+
|
39
|
+
def child_count
|
40
|
+
children.size
|
41
|
+
end
|
42
|
+
|
43
|
+
def each &block
|
44
|
+
children.each &block
|
45
|
+
end
|
46
|
+
|
31
47
|
def octets
|
32
48
|
text.bytesize
|
33
49
|
end
|
@@ -60,23 +76,11 @@ module ABNF
|
|
60
76
|
@children = children
|
61
77
|
end
|
62
78
|
|
63
|
-
def [] index
|
64
|
-
children[index]
|
65
|
-
end
|
66
|
-
|
67
79
|
def add child
|
68
80
|
children << child
|
69
81
|
end
|
70
82
|
alias_method :<<, :add
|
71
83
|
|
72
|
-
def child_count
|
73
|
-
children.size
|
74
|
-
end
|
75
|
-
|
76
|
-
def each &block
|
77
|
-
children.each &block
|
78
|
-
end
|
79
|
-
|
80
84
|
def text
|
81
85
|
@text ||= to_a.join
|
82
86
|
end
|