Module: Yamlr::Reader::Node
- Defined in:
- lib/yamlr/reader/node.rb
Class Method Summary collapse
-
.document(idc, spc) ⇒ Object
docstart and docterm.
-
.hashkey(hsh, spc) ⇒ Object
hashkey is awesome.
-
.hashkey_sym(hsh, sym, spc) ⇒ Object
hashkey is symbol.
-
.hashpair(hsh, sym, spc) ⇒ Object
hashpair.
-
.hashpair_sym_all(hsh, sym, spc) ⇒ Object
hashpair, both key and val are symbol.
-
.hashpair_sym_key(hsh, sym, spc) ⇒ Object
hashpair, key is symbol.
-
.hashpair_sym_val(hsh, sym, spc) ⇒ Object
hashpair, value is symbol.
-
.left_match(idc, spc) ⇒ Object
comments and arrays.
Class Method Details
.document(idc, spc) ⇒ Object
docstart and docterm
42 43 44 |
# File 'lib/yamlr/reader/node.rb', line 42 def self.document(idc, spc) /^#{spc}*#{idc}#{spc}*$/ end |
.hashkey(hsh, spc) ⇒ Object
hashkey is awesome
36 37 38 |
# File 'lib/yamlr/reader/node.rb', line 36 def self.hashkey(hsh, spc) /^(#{spc}*)(\S*)#{hsh}#{spc}*$/ end |
.hashkey_sym(hsh, sym, spc) ⇒ Object
hashkey is symbol
30 31 32 |
# File 'lib/yamlr/reader/node.rb', line 30 def self.hashkey_sym(hsh, sym, spc) /^(#{spc}*)(#{sym}\S*)#{hsh}#{spc}*$/ end |
.hashpair(hsh, sym, spc) ⇒ Object
hashpair
6 7 8 |
# File 'lib/yamlr/reader/node.rb', line 6 def self.hashpair(hsh, sym, spc) /^(#{spc}*)(\S*)#{hsh}#{spc}*(.*)#{spc}*$/ end |
.hashpair_sym_all(hsh, sym, spc) ⇒ Object
hashpair, both key and val are symbol
12 13 14 |
# File 'lib/yamlr/reader/node.rb', line 12 def self.hashpair_sym_all(hsh, sym, spc) /^(#{spc}*)(#{sym}\S*)#{hsh}#{spc}*(#{sym}.*)#{spc}*$/ end |
.hashpair_sym_key(hsh, sym, spc) ⇒ Object
hashpair, key is symbol
18 19 20 |
# File 'lib/yamlr/reader/node.rb', line 18 def self.hashpair_sym_key(hsh, sym, spc) /^(#{spc}*)(#{sym}\S*)#{hsh}#{spc}*(.*)#{spc}*$/ end |
.hashpair_sym_val(hsh, sym, spc) ⇒ Object
hashpair, value is symbol
24 25 26 |
# File 'lib/yamlr/reader/node.rb', line 24 def self.hashpair_sym_val(hsh, sym, spc) /^(#{spc}*)(\S*)#{hsh}#{spc}*(#{sym}.*)#{spc}*$/ end |
.left_match(idc, spc) ⇒ Object
comments and arrays
48 49 50 |
# File 'lib/yamlr/reader/node.rb', line 48 def self.left_match(idc, spc) /^(#{spc}*)#{idc}(#{spc}*)(.*)#{spc}*$/ end |