Sha256: d742b5eb18dfc30cd2ef6f71d8a6a1b6a574f0ea3ae3d08b4decdf783ec665a8

Contents?: true

Size: 432 Bytes

Versions: 1

Compression:

Stored size: 432 Bytes

Contents

module Nanoc
  class MutableItemView < Nanoc::ItemView
    # Sets the value for the given attribute.
    #
    # @param [Symbol] key
    #
    # @see Hash#[]=
    def []=(key, value)
      unwrap[key] = value
    end

    # Updates the attributes based on the given hash.
    #
    # @param [Hash] hash
    #
    # @return [self]
    def update_attributes(hash)
      hash.each { |k, v| unwrap[k] = v }
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanoc-4.0.0b3 lib/nanoc/base/views/mutable_item.rb