class NETSNMP::MIB::Parser
Public Instance Methods
bracketed(atom)
click to toggle source
# File lib/netsnmp/mib/parser.rb, line 21 def bracketed(atom) str("(") >> space.repeat >> atom >> space.repeat >> str(")") end
curly(atom)
click to toggle source
# File lib/netsnmp/mib/parser.rb, line 17 def curly(atom) str("{") >> space.repeat >> atom >> space.repeat >> str("}") end
spaced(character = nil) { |>> repeat| ... }
click to toggle source
# File lib/netsnmp/mib/parser.rb, line 9 def spaced(character = nil) if character.nil? && block_given? yield >> space.repeat else str(character) >> space.repeat end end
square_bracketed(atom)
click to toggle source
# File lib/netsnmp/mib/parser.rb, line 25 def square_bracketed(atom) str("[") >> space.repeat >> atom >> space.repeat >> str("]") end
with_separator(atom, separator = nil)
click to toggle source
# File lib/netsnmp/mib/parser.rb, line 29 def with_separator(atom, separator = nil) if separator sep = if separator.is_a?(String) space.repeat >> str(separator) >> space.repeat else separator end atom >> (sep >> atom).repeat else atom >> (space.repeat >> atom).repeat end end