Sha256: 7ea02ac68c45b25be82779a83d0751a159975c3558bc743b87a1b6397c9a4b3e

Contents?: true

Size: 332 Bytes

Versions: 1

Compression:

Stored size: 332 Bytes

Contents

module Gliffynator
  module DSL
    def get_id_and_increment(klass)
      id = self.objects.global_id_counter
      self.objects.global_id_counter = klass.id_usage || 1

      id
    end

    def add_arrow(*args)
      id = get_id_and_increment(Arrow)
      self.objects << Gliffynator::Arrow.create(id, *args)
    end



  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gliffynator-0.0.1 lib/gliffynator/dsl.rb