Sha256: 3ef41654a27bb0a5d9ca22d3c3fc18bce89965e415c56f2f23ef15a02b1adb2f

Contents?: true

Size: 1.41 KB

Versions: 13

Compression:

Stored size: 1.41 KB

Contents

module Image
  include DataMapper::Resource

  is :remixable

  property :id,           Serial
  property :description,  String
  property :path,         String

  after :save, :hook_method

  def hook_method
    @hook_method = true
  end

  def hook_method_called?
    defined?(@hook_method) ? true : false
  end

  # These methods will be available to the class remixing this module
  #   If 'User' remixes 'Images', these methods will be available to a User class
  #
  module RemixerClassMethods
    def test_remixer_class_method
      'CLASS METHOD FOR REMIXER'
    end
  end

  # These methods will be available to instantiated objects of the remixing this module
  #   If 'User' remixes 'Images', these methods will be available to a User object
  #
  module RemixerInstanceMethods
    def test_remixer_instance_method
      'INSTANCE METHOD FOR REMIXER'
    end
  end

  # These methods will be available to the Generated Remixed Class
  #   If 'User' remixes 'Images', these methods will be available to UserImage class
  #
  module RemixeeClassMethods
    def test_remixee_class_method
      'CLASS METHOD FOR REMIXEE'
    end
  end

  # These methods will be available to an instantiated Generated Remixed Class
  #   If 'User' remixes 'Images', these methods will be available to a UserImage object
  #
  module RemixeeInstanceMethods
    def test_remixee_instance_method
      'INSTANCE METHOD FOR REMIXEE'
    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dm-is-remixable-1.2.0 spec/data/image.rb
dm-is-remixable-1.2.0.rc2 spec/data/image.rb
dm-is-remixable-1.2.0.rc1 spec/data/image.rb
dm-is-remixable-1.1.0 spec/data/image.rb
dm-is-remixable-1.1.0.rc3 spec/data/image.rb
dm-is-remixable-1.1.0.rc2 spec/data/image.rb
dm-is-remixable-1.1.0.rc1 spec/data/image.rb
dm-is-remixable-1.0.2 spec/data/image.rb
dm-is-remixable-1.0.1 spec/data/image.rb
dm-is-remixable-1.0.0 spec/data/image.rb
dm-is-remixable-1.0.0.rc3 spec/data/image.rb
dm-is-remixable-1.0.0.rc2 spec/data/image.rb
dm-is-remixable-1.0.0.rc1 spec/data/image.rb