Sha256: b1c268612397c7ab962cbd789b8070220a909712c8472148f7b69d0267aa8a99
Contents?: true
Size: 977 Bytes
Versions: 4
Compression:
Stored size: 977 Bytes
Contents
module WWMD class Inputs attr_accessor :elems @cobj = '' # wwmd object @elems = '' # array of elems parse out by self.new() def initialize(*args) @cobj = args.shift end def show putx @elems end # call me from Page.set_data def set @elems = [@cobj.search("//input").map,@cobj.search("//select").map].flatten end def get(attr=nil) @elems.map { |x| x[attr] }.reject { |y| y.nil? } end # # return: FormArray containing all page inputs def form ret = {} @elems.map do |x| name = x['name'] id = x['id'] next if (name.nil? && id.nil?) value = x['value'] type = x['type'] ret[name] = value ret[id] = value if ((id || name) != name) end return FormArray.new(ret) end # # return: FormArray containing get params def params return FormArray.new(@cobj.cur.clop.to_form) end end end
Version data entries
4 entries across 4 versions & 3 rubygems
Version | Path |
---|---|
iZsh-wwmd-0.2.19 | lib/wwmd/page/inputs.rb |
miketracy-wwmd-0.2.17 | lib/wwmd/page/inputs.rb |
miketracy-wwmd-0.2.19 | lib/wwmd/page/inputs.rb |
wwmd-0.2.20.3 | lib/wwmd/page/inputs.rb |