Sha256: f30e8fcb16d9a365cd88d42450add2e0d08c49b9a5e5e07d7657998bbbcc36f2

Contents?: true

Size: 607 Bytes

Versions: 20

Compression:

Stored size: 607 Bytes

Contents

module Ddr::Models::Structures
  #
  # Wraps a Nokogiri (XML) 'fileGrp' node
  #
  class FileGrp < SimpleDelegator

    def id
      self['ID']
    end

    def use
      self['USE']
    end

    def filegrps
      xpath('xmlns:filegrp').map { |node| FileGrp.new(node) }
    end

    def files
      xpath('xmlns:file').map { |node| File.new(node) }
    end

    def effective_use
      use
    end

    def self.build(args)
      node = Nokogiri::XML::Node.new('fileGrp', args[:document])
      node['ID'] = args[:id] if args[:id]
      node['USE'] = args[:use] if args[:use]
      node
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/models/structures/file_grp.rb
ddr-models-2.10.2 lib/ddr/models/structures/file_grp.rb
ddr-models-2.10.1 lib/ddr/models/structures/file_grp.rb
ddr-models-2.10.0 lib/ddr/models/structures/file_grp.rb
ddr-models-2.10.0.rc2 lib/ddr/models/structures/file_grp.rb
ddr-models-2.10.0.rc1 lib/ddr/models/structures/file_grp.rb
ddr-models-2.9.2 lib/ddr/models/structures/file_grp.rb
ddr-models-2.9.1 lib/ddr/models/structures/file_grp.rb
ddr-models-2.9.0 lib/ddr/models/structures/file_grp.rb
ddr-models-2.9.0.rc1 lib/ddr/models/structures/file_grp.rb
ddr-models-2.8.0 lib/ddr/models/structures/file_grp.rb
ddr-models-2.8.0.rc1 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.6 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.5 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.4 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.3 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.2 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.1 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.0 lib/ddr/models/structures/file_grp.rb
ddr-models-2.7.0.rc1 lib/ddr/models/structures/file_grp.rb