Class: Ezframe::Ht::List
Overview
配列を<UL><OL>要素に変換するためのクラス
Instance Attribute Summary collapse
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
Methods inherited from Array
Instance Attribute Details
#tag ⇒ Object
Returns the value of attribute tag.
120 121 122 |
# File 'lib/ezframe/ht.rb', line 120 def tag @tag end |
Instance Method Details
#to_h(opts = {}) ⇒ Object
121 122 123 124 125 126 127 128 129 |
# File 'lib/ezframe/ht.rb', line 121 def to_h(opts = {}) return nil if self.empty? child = self.map do |elem| { tag: "li", child: elem } end h = { tag: @tag, child: child } h.update(opts) return h end |