Sha256: 2854ec0bc59873553acfaec8b08695b9f9264dbc6f6e5aad6ce668e026c272bc

Contents?: true

Size: 527 Bytes

Versions: 9

Compression:

Stored size: 527 Bytes

Contents

module Bowline
  module Binders
    class Singleton < Base
      class << self
        def item
          @item
        end
        
        def item=(arg)
          @item = arg
          self.item_sync!
        end
    
        def item_sync!
          return unless @item && @elements
          # Call the chain.js function 'item' on elements
          @elements.each {|i| 
            i.updateSingleton(@item.to_js) 
          }
        end
      
        def find(*a)
          @item
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
maccman-bowline-0.3.0 lib/bowline/binders/singleton.rb
maccman-bowline-0.3.1 lib/bowline/binders/singleton.rb
maccman-bowline-0.3.3 lib/bowline/binders/singleton.rb
maccman-bowline-0.3.5 lib/bowline/binders/singleton.rb
maccman-bowline-0.3.6 lib/bowline/binders/singleton.rb
maccman-bowline-0.3.7 lib/bowline/binders/singleton.rb
maccman-bowline-0.3.9 lib/bowline/binders/singleton.rb
maccman-bowline-0.4.0 lib/bowline/binders/singleton.rb
bowline-0.3.9 lib/bowline/binders/singleton.rb