Sha256: 5ed487fd6ecd879b9234426154ac71e2c7c6b0c721d5991d0fb7dbc01e29066a

Contents?: true

Size: 757 Bytes

Versions: 6

Compression:

Stored size: 757 Bytes

Contents

module Hallon::Observable
  # Callbacks related to {Hallon::Image} objects.
  module Image
    # Includes {Hallon::Observable} for you.
    def self.extended(other)
      other.send(:include, Hallon::Observable)
    end

    protected

    # @return [Method] load callback
    def initialize_callbacks
      callback_for(:load)
    end

    # This callback is fired when the Image object is fully loaded.
    #
    # @example listening to this callback
    #   image = Image.new("spotify:image:3ad93423add99766e02d563605c6e76ed2b0e450")
    #   image.on(:load) do
    #     puts "Image has loaded"
    #   end
    #
    # @yield [self]
    # @yieldparam [Image] self
    def load_callback(pointer, userdata)
      trigger(pointer, :load)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hallon-0.17.0 lib/hallon/observable/image.rb
hallon-0.16.0 lib/hallon/observable/image.rb
hallon-0.15.0 lib/hallon/observable/image.rb
hallon-0.14.0 lib/hallon/observable/image.rb
hallon-0.13.0 lib/hallon/observable/image.rb
hallon-0.12.0 lib/hallon/observable/image.rb