Sha256: 3661f4d1a1c8d8164bddb5a47a2830d946b1132098d1cf805a3b7070b5f1bfb8

Contents?: true

Size: 433 Bytes

Versions: 9

Compression:

Stored size: 433 Bytes

Contents

# encoding: utf-8

module Punchblock
  class MediaNode < RayoNode
    include MediaContainer

    def self.new(options = {})
      super().tap do |new_node|
        case options
        when Hash
          new_node << options.delete(:text) if options[:text]
          options.each_pair { |k,v| new_node.send :"#{k}=", v }
        when Nokogiri::XML::Element
          new_node.inherit options
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
punchblock-1.4.1 lib/punchblock/media_node.rb
punchblock-1.4.0 lib/punchblock/media_node.rb
punchblock-1.3.0 lib/punchblock/media_node.rb
punchblock-1.2.0 lib/punchblock/media_node.rb
punchblock-1.1.0 lib/punchblock/media_node.rb
punchblock-1.0.0 lib/punchblock/media_node.rb
punchblock-0.12.0 lib/punchblock/media_node.rb
punchblock-0.11.0 lib/punchblock/media_node.rb
punchblock-0.10.0 lib/punchblock/media_node.rb