Module: Cheeba::Reader::Node

Defined in:
lib/cheeba/reader/node.rb

Class Method Summary collapse

Class Method Details

.document(idc, spc) ⇒ Object

docstart and docterm



49
50
51
# File 'lib/cheeba/reader/node.rb', line 49

def self.document(idc, spc)
  /^#{spc}*#{idc}#{spc}*$/
end

.hashkey(hsh, spc) ⇒ Object

hashkey is awesome



42
43
44
# File 'lib/cheeba/reader/node.rb', line 42

def self.hashkey(hsh, spc)
  /^(#{spc}*)(\S*)#{hsh}#{spc}*$/ 
end

.hashkey_sym(hsh, sym, spc) ⇒ Object

hashkey is symbol



35
36
37
# File 'lib/cheeba/reader/node.rb', line 35

def self.hashkey_sym(hsh, sym, spc)
  /^(#{spc}*)(#{sym}\S*)#{hsh}#{spc}*$/ 
end

.hashpair(hsh, sym, spc) ⇒ Object

hashpair



7
8
9
# File 'lib/cheeba/reader/node.rb', line 7

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



14
15
16
# File 'lib/cheeba/reader/node.rb', line 14

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



21
22
23
# File 'lib/cheeba/reader/node.rb', line 21

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



28
29
30
# File 'lib/cheeba/reader/node.rb', line 28

def self.hashpair_sym_val(hsh, sym, spc)
  /^(#{spc}*)(\S*)#{hsh}#{spc}*(#{sym}.*)#{spc}*$/
end

.left_match(idc, spc) ⇒ Object

comments and arrays



56
57
58
# File 'lib/cheeba/reader/node.rb', line 56

def self.left_match(idc, spc)
  /^(#{spc}*)#{idc}(#{spc}*)(.*)#{spc}*$/ 
end