class RubyGPG2::StatusOutput

Public Class Methods

new(lines) click to toggle source
# File lib/ruby_gpg2/status_output.rb, line 12
def initialize(lines)
  @lines = lines
end
parse(lines) click to toggle source
# File lib/ruby_gpg2/status_output.rb, line 5
def self.parse(lines)
  new(lines
      .strip
      .split("\n")
      .collect { |line| StatusLine.parse(line) })
end

Public Instance Methods

==(other) click to toggle source
# File lib/ruby_gpg2/status_output.rb, line 24
def ==(other)
  other.class == self.class && other.state == state
end
filter_by_type(type) click to toggle source
# File lib/ruby_gpg2/status_output.rb, line 16
def filter_by_type(type)
  StatusOutput.new(@lines.filter { |l| l.type == type })
end
first_line() click to toggle source
# File lib/ruby_gpg2/status_output.rb, line 20
def first_line
  @lines.first
end

Protected Instance Methods

state() click to toggle source
# File lib/ruby_gpg2/status_output.rb, line 30
def state
  [@lines]
end