Class: Hermeneutics::Cli::ImapTools::ResponseData

Inherits:
Response
  • Object
show all
Defined in:
lib/hermeneutics/cli/imap.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Response

#bye?, #done?, #wait?

Constructor Details

#initialize(num, data) ⇒ ResponseData

Returns a new instance of ResponseData.



192
193
194
# File 'lib/hermeneutics/cli/imap.rb', line 192

def initialize num, data
  @num, @data = num, data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



191
192
193
# File 'lib/hermeneutics/cli/imap.rb', line 191

def data
  @data
end

#numObject (readonly)

Returns the value of attribute num.



191
192
193
# File 'lib/hermeneutics/cli/imap.rb', line 191

def num
  @num
end

Class Method Details

.create(reader) ⇒ Object



183
184
185
186
187
188
189
# File 'lib/hermeneutics/cli/imap.rb', line 183

def create reader
  if reader.peekline.slice! /\A(\d+) +/ then
    n = $1.to_i
  end
  data = compile_stream reader
  new n, data
end

Instance Method Details

#to_sObject



195
# File 'lib/hermeneutics/cli/imap.rb', line 195

def to_s ; "#{num} #{data}" ; end