Sha256: 834ef63449e52c1ce27e8a5130e785174acab7108afefc71f8e2ff9f0251c124

Contents?: true

Size: 654 Bytes

Versions: 26

Compression:

Stored size: 654 Bytes

Contents

module Bowline
  class JQuery
    # Equivalent to: $.foo()
    def method_missing(sym, args)
      self.class.dollar.send(sym, *args)
    end
    
    class << self
      # Equivalent to: $('#item_id')
      def for_element(el)
        Bowline::js.send("jQuery", el)
      end
      
      # For binding global events
      # Equivalent to: $('body').bind()
      def bind(event, fun, data)
        for_element("body").bind(event, data, fun)
      end
      
      # Equivalent to: $
      def dollar
        Bowline::js.send("jQuery")
      end
      
      # Equivalent to: $.bowline
      def bowline
        dollar.bowline
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
maccman-bowline-0.1.1 lib/bowline/jquery.rb
maccman-bowline-0.1.10 lib/bowline/jquery.rb
maccman-bowline-0.1.2 lib/bowline/jquery.rb
maccman-bowline-0.1.3 lib/bowline/jquery.rb
maccman-bowline-0.1.4 lib/bowline/jquery.rb
maccman-bowline-0.1.6 lib/bowline/jquery.rb
maccman-bowline-0.1.7 lib/bowline/jquery.rb
maccman-bowline-0.1.8 lib/bowline/jquery.rb
maccman-bowline-0.3.0 lib/bowline/jquery.rb
maccman-bowline-0.3.1 lib/bowline/jquery.rb
maccman-bowline-0.3.3 lib/bowline/jquery.rb
maccman-bowline-0.3.5 lib/bowline/jquery.rb
maccman-bowline-0.3.6 lib/bowline/jquery.rb
maccman-bowline-0.3.7 lib/bowline/jquery.rb
maccman-bowline-0.3.9 lib/bowline/jquery.rb
maccman-bowline-0.4.0 lib/bowline/jquery.rb
maccman-bowline-0.4.1 lib/bowline/jquery.rb
maccman-bowline-0.4.3 lib/bowline/jquery.rb
maccman-bowline-0.4.4 lib/bowline/jquery.rb
maccman-bowline-0.4.5 lib/bowline/jquery.rb