Module: Amrita2::ModelData
Overview
:nodoc:
Defined Under Namespace
Classes: AttrArray, MultiValue, Tuple
Instance Method Summary collapse
Instance Method Details
#a(hash = {}, &block) ⇒ Object
1342 1343 1344 |
# File 'lib/amrita2/core.rb', line 1342 def a(hash={}, &block) AttrArray.new(hash, &block) end |
#e(tag, hash = {}) ⇒ Object
1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
# File 'lib/amrita2/core.rb', line 1326 def e(tag, hash={}) ret = REXML::Element.new(tag.to_s) hash.each do |k, v| ret.attributes[k.to_s] = v end if block_given? case child = yield when REXML::Element ret.add child else ret.text = child end end ret end |