Object
Class used by Markaby::Builder to store element options. Methods called against the CssProxy object are added as element classes or IDs.
See the README for examples.
Adds attributes to an element. Bang methods set the :id attribute. Other methods add to the :class attribute.
# File lib/markaby/cssproxy.rb, line 26 26: def method_missing(id_or_class, *args, &block) 27: if id_or_class.to_s =~ /(.*)!$/ 28: @attrs[:id] = $1 29: else 30: id = id_or_class 31: @attrs[:class] = @attrs[:class] ? "#{@attrs[:class]} #{id}".strip : id 32: end 33: 34: unless args.empty? 35: if args.last.respond_to? :to_hash 36: @attrs.merge! args.pop.to_hash 37: end 38: end 39: 40: args.push(@attrs) 41: 42: while @stream.length > @original_stream_length 43: @stream.pop 44: end 45: 46: if block 47: @builder.tag! @sym, *args, &block 48: else 49: @builder.tag! @sym, *args 50: end 51: 52: self 53: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.