Sha256: ca5b8482f676588370786a5cf4cc3d24182081754ef88a2aeba8eeea547a95ca
Contents?: true
Size: 713 Bytes
Versions: 12
Compression:
Stored size: 713 Bytes
Contents
module Atom module Extensions class Property include Atom::Xml::Parseable namespace "http://custom.namespace" attribute :name, :value def initialize(name = nil, value = nil) if name && value initialize_with_o :name => name, :value => value else initialize_with_o(name) { yield if block_given? } end end def initialize_with_o(o = nil) case o when String, Nokogiri::XML::Reader parse o, :once => true when Hash o.each do |name,value| self.send :"#{name}=", value end else yield(self) if block_given? end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems