Class: Ezframe::Ht::List

Inherits:
Array show all
Defined in:
lib/ezframe/ht.rb

Overview

配列を<UL><OL>要素に変換するためのクラス

Direct Known Subclasses

Ol, Ul

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#symbolize_keys

Instance Attribute Details

#tagObject

Returns the value of attribute tag.



122
123
124
# File 'lib/ezframe/ht.rb', line 122

def tag
  @tag
end

Instance Method Details

#to_h(opts = {}) ⇒ Object



123
124
125
126
127
128
129
# File 'lib/ezframe/ht.rb', line 123

def to_h(opts = {})
  return nil if self.empty?
  child = self.map { |elem| Ht.li(elem) }
  h = { tag: @tag, wrap: true, child: child }
  h.update(opts)
  return h
end