Sha256: 3834640c2f0a5335777e96b86702e2986556d283e28af5df50a7a17683b8bc75

Contents?: true

Size: 553 Bytes

Versions: 7

Compression:

Stored size: 553 Bytes

Contents

##
# Many modules in this gem require that the class which includes them has a property called `data`. This module can be used by modules which require the use 
# of the `data` property to ensure that they are being used correctly. If `data` is not a property, a `TypeError` will be thrown upon inclusion into the class.
module Digiproc::RequiresData
    def self.included(base)
        raise TypeError.new("To implement #{self}, #{base} must have an instance varaible @data, and getters/setters") if not base.method_defined?(:data) 
    end 
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
digiproc-0.2.5 lib/concerns/requires_data.rb
digiproc-0.2.4 lib/concerns/requires_data.rb
digiproc-0.2.3 lib/concerns/requires_data.rb
digiproc-0.2.2 lib/concerns/requires_data.rb
digiproc-0.2.1 lib/concerns/requires_data.rb
digiproc-0.2.0 lib/concerns/requires_data.rb
digiproc-0.1.0 lib/concerns/requires_data.rb