Class: RubyGPG2::StatusOutput
- Inherits:
-
Object
- Object
- RubyGPG2::StatusOutput
- Defined in:
- lib/ruby_gpg2/status_output.rb
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #filter_by_type(type) ⇒ Object
- #first_line ⇒ Object
-
#initialize(lines) ⇒ StatusOutput
constructor
A new instance of StatusOutput.
Constructor Details
#initialize(lines) ⇒ StatusOutput
Returns a new instance of StatusOutput.
14 15 16 |
# File 'lib/ruby_gpg2/status_output.rb', line 14 def initialize(lines) @lines = lines end |
Class Method Details
.parse(lines) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/ruby_gpg2/status_output.rb', line 7 def self.parse(lines) new(lines .strip .split("\n") .collect { |line| StatusLine.parse(line) }) end |
Instance Method Details
#==(other) ⇒ Object
26 27 28 |
# File 'lib/ruby_gpg2/status_output.rb', line 26 def ==(other) other.class == self.class && other.state == state end |
#filter_by_type(type) ⇒ Object
18 19 20 |
# File 'lib/ruby_gpg2/status_output.rb', line 18 def filter_by_type(type) StatusOutput.new(@lines.filter { |l| l.type == type }) end |
#first_line ⇒ Object
22 23 24 |
# File 'lib/ruby_gpg2/status_output.rb', line 22 def first_line @lines.first end |