Class: Arbo::HTML::Attributes

Inherits:
Hash
  • Object
show all
Defined in:
lib/arbo/html/attributes.rb

Instance Method Summary collapse

Instance Method Details

#any?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/arbo/html/attributes.rb', line 13

def any?
  super{ |k,v| !value_empty?(v) }
end

#to_sObject



6
7
8
9
10
11
# File 'lib/arbo/html/attributes.rb', line 6

def to_s
  flatten_hash.map do |name, value|
    next if value_empty?(value)
    "#{html_escape(name)}=\"#{html_escape(value)}\""
  end.compact.join ' '
end