Class: SetecAstronomy::KeePass::Group
- Inherits:
-
Object
- Object
- SetecAstronomy::KeePass::Group
- Defined in:
- lib/setec_astronomy/kee_pass/group.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(payload_io) ⇒ Group
constructor
A new instance of Group.
- #length ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(payload_io) ⇒ Group
Returns a new instance of Group.
35 36 37 38 39 40 41 42 43 |
# File 'lib/setec_astronomy/kee_pass/group.rb', line 35 def initialize(payload_io) fields = [] begin field = GroupField.new(payload_io) fields << field end while not field.terminator? @fields = fields end |
Class Method Details
Instance Method Details
#length ⇒ Object
45 46 47 |
# File 'lib/setec_astronomy/kee_pass/group.rb', line 45 def length @fields.map(&:length).reduce(&:+) end |
#name ⇒ Object
49 50 51 |
# File 'lib/setec_astronomy/kee_pass/group.rb', line 49 def name @fields.detect { |field| field.name == 'group_name' }.data.chomp("\000") end |