Class: Hermeneutics::Cli::ImapTools::Data::Compiler
- Inherits:
-
Object
- Object
- Hermeneutics::Cli::ImapTools::Data::Compiler
- Defined in:
- lib/hermeneutics/cli/imap/parser.rb
Instance Method Summary collapse
- #add(x) ⇒ Object
- #finish ⇒ Object
-
#initialize ⇒ Compiler
constructor
A new instance of Compiler.
- #result ⇒ Object
- #step ⇒ Object
Constructor Details
#initialize ⇒ Compiler
Returns a new instance of Compiler.
197 198 199 |
# File 'lib/hermeneutics/cli/imap/parser.rb', line 197 def initialize @list = [] end |
Instance Method Details
#add(x) ⇒ Object
214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/hermeneutics/cli/imap/parser.rb', line 214 def add x if @sub then @list.push x else if not @name then is_name? x or raise "Not an item name: #{x}" @name = x.to_sym else @list.push x end end end |
#finish ⇒ Object
227 228 |
# File 'lib/hermeneutics/cli/imap/parser.rb', line 227 def finish end |
#result ⇒ Object
201 202 203 |
# File 'lib/hermeneutics/cli/imap/parser.rb', line 201 def result Data.new @name, *@list end |
#step ⇒ Object
205 206 207 208 209 210 211 212 |
# File 'lib/hermeneutics/cli/imap/parser.rb', line 205 def step list_, @list = @list, [] sub_, @sub = @sub, true yield ensure list_.push @list @list, @sub = list_, sub_ end |