Parent

MaRuKu::AttributeList

Public Instance Methods

push_class(val) click to toggle source
# File lib/maruku/attributes.rb, line 54
def push_class(val);        
        raise "Bad :id #{val.inspect}" if not val
        push [:class,  val] 
end
push_id(val) click to toggle source
# File lib/maruku/attributes.rb, line 58
def push_id(val);           
        raise "Bad :id #{val.inspect}" if not val
        push [:id,  val] 
end
push_key_val(key, val) click to toggle source

An attribute list becomes {id .cl key="val" ref}

[:id, 'id'], [:class, 'id'], ['key', 'val'], [ :ref, 'ref' ]
# File lib/maruku/attributes.rb, line 43
def push_key_val(key, val); 
        raise "Bad #{key.inspect}=#{val.inspect}" if not key and val
        push [key, val] 
end
push_ref(ref_id) click to toggle source
# File lib/maruku/attributes.rb, line 47
                def push_ref(ref_id);       
                        
                        raise "Bad :ref #{ref_id.inspect}" if not ref_id
                        push [:ref, ref_id+""] 

#                       p "Now ", self ########################################
                end
to_md() click to toggle source
Alias for: to_s
to_s() click to toggle source
# File lib/maruku/attributes.rb, line 63
def to_s
        map do |k,v|
                case k
                when :id;    "#" + v.quote_if_needed
                when :class; "." + v.quote_if_needed
                when :ref;    v.quote_if_needed
                else k.quote_if_needed + "=" + v.quote_if_needed
                end
        end . join(' ')
end
Also aliased as: to_md

[Validate]

Generated with the Darkfish Rdoc Generator 2.