Sha256: c5fc1ae14f4f84ab560ae3d4a8314a78187dbdf74e3ee47db982424a5512901d

Contents?: true

Size: 468 Bytes

Versions: 2

Compression:

Stored size: 468 Bytes

Contents

module Rubiks
  module Dimension
    def self.included(klass)
      klass.extend Rubiks::Dimension::ClassMethods
    end

    module ClassMethods
      def hierarchy(name, &block)
        new_hierarchy = Hierarchy.new(name)
        new_hierarchy.instance_eval(&block) if block_given?
        hierarchies << new_hierarchy
      end

      def hierarchies
        @hierarchies ||= []
      end
    end

    def hierarchies
      self.class.hierarchies
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubiks-0.0.3 lib/rubiks/dimension.rb
rubiks-0.0.2 lib/rubiks/dimension.rb