Class: JQuery::Methods
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(els) ⇒ Methods
constructor
A new instance of Methods.
- #named_list ⇒ Object
Methods inherited from Array
Constructor Details
#initialize(els) ⇒ Methods
Returns a new instance of Methods.
70 71 72 73 74 75 76 |
# File 'lib/jquery-cheat.rb', line 70 def initialize els if(els.is_a?(Hash)) push(*JQuery::Parser.get_methods_by_hash(els).to_jquery_methods) else push(*els.to_jquery_methods) end end |
Class Method Details
.get_methods(options = {}) ⇒ Object
78 79 80 |
# File 'lib/jquery-cheat.rb', line 78 def self.get_methods = {} JQuery::Parser.get_methods_by_hash() end |
.with_name_and_params(name, *params) ⇒ Object
82 83 84 |
# File 'lib/jquery-cheat.rb', line 82 def self.with_name_and_params name, *params new(@@parsed.search("method[@name='#{name}']").reject{|m| params.any? {|p| m.search("params[@name=#{p}]").length == 0 } }) end |
Instance Method Details
#named_list ⇒ Object
86 87 88 89 |
# File 'lib/jquery-cheat.rb', line 86 def named_list list = inject([]) {|s,m| s.push(m.signature) } list.empty? ? ["No items found"] : list end |