Sha256: 69ac94ed5ad2f1bd9106fcb534873772ff0e330d2ab31b735339a8cb3ca72ede

Contents?: true

Size: 599 Bytes

Versions: 33

Compression:

Stored size: 599 Bytes

Contents

module Ddr::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

33 entries across 33 versions & 1 rubygems

Version Path
ddr-core-1.4.0 lib/ddr/structures/file_grp.rb
ddr-core-1.3.0 lib/ddr/structures/file_grp.rb
ddr-core-1.2.0 lib/ddr/structures/file_grp.rb
ddr-core-1.2.0.rc3 lib/ddr/structures/file_grp.rb
ddr-core-1.2.0.rc2 lib/ddr/structures/file_grp.rb
ddr-core-1.2.0.rc1 lib/ddr/structures/file_grp.rb
ddr-core-1.1.2 lib/ddr/structures/file_grp.rb
ddr-core-1.1.1 lib/ddr/structures/file_grp.rb
ddr-core-1.1.0 lib/ddr/structures/file_grp.rb
ddr-core-1.0.0 lib/ddr/structures/file_grp.rb
ddr-core-0.3.0 lib/ddr/structures/file_grp.rb
ddr-core-0.2.2 lib/ddr/structures/file_grp.rb
ddr-core-0.2.1 lib/ddr/structures/file_grp.rb