Sha256: fd8b65fc3bdb425d57feb8ada310881dbe7e307857379af8ec6c3e2432af0b1d

Contents?: true

Size: 839 Bytes

Versions: 8

Compression:

Stored size: 839 Bytes

Contents

module XCRes
  class Section

    # @return [String]
    #         the name / key of the section
    attr_reader :name

    # @return [Hash{String => String|Hash}]
    #         the items of the section
    attr_reader :items

    # @return [Hash]
    #         options of the section for serialization
    attr_accessor :options

    # Initialize a new section
    #
    # @param  [String] name
    #         see #name
    #
    # @param  [Hash] items
    #         see #items
    #
    # @param  [Hash] options
    #         see #options
    #
    #
    def initialize(name, items, options={})
      @name  = name
      @items = items
      @options = options
    end

    def ==(other)
      self.name == other.name \
        && self.items == other.items \
        && self.options == other.options
    end

    alias eql? ==

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
xcres-0.6.1 lib/xcres/model/section.rb
xcres-0.6.0 lib/xcres/model/section.rb
xcres-0.5.0 lib/xcres/model/section.rb
xcres-0.4.4 lib/xcres/model/section.rb
xcres-0.4.3 lib/xcres/model/section.rb
xcres-0.4.2 lib/xcres/model/section.rb
xcres-0.4.1 lib/xcres/model/section.rb
xcres-0.4.0 lib/xcres/model/section.rb