Class: Markaby::CssProxy

Class | Markaby::CssProxy
In: | lib/markaby/cssproxy.rb
Parent: | 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.

### Methods

merge! method_missing new to_s to_str

### Public Class methods

new(opts = {}, &blk)

Creates a CssProxy object. The `opts` and `block` passed in are stored until the element is created by Builder.tag!

### Public Instance methods

merge!(opts)

Adds attributes to an element, for internal use only. For example, if you want to write a wrapper which sets a bunch of default attributes for a certain tag. Like the default `img’ method included with Markaby automatically sets an empty alt attribute.

method_missing(id_or_class, *args, &blk)

Adds attributes to an element. Bang methods set the :id attribute. Other methods add to the :class attribute. If a block is supplied, it is executed with a merged hash (@opts + args).

to_s()

Alias for to_str

to_str()

[Validate]