Module: AcceptHashAndYieldSelf

Included in:
EPUB::OCF::Container::Rootfile, EPUB::Publication::Package
Defined in:
lib/epub.rb

Instance Method Summary (collapse)

Instance Method Details

- (AcceptHashAndYieldSelf) initialize(attrs = {}) { ... }

A new instance of AcceptHashAndYieldSelf

Parameters:

  • attrs (Hash) (defaults to: {})

Yields:

  • self



4
5
6
7
8
9
10
# File 'lib/epub.rb', line 4

def initialize(attrs={})
  attrs.each_pair do |attr, value|
    setter = "#{attr}="
    __send__ setter, value if respond_to? setter
  end
  yield self
end