Sha256: 07ac43ab2c86e9e8f428e60a2cf7f9e1ca8f2572c3249a0c0aa2f57922bb262c

Contents?: true

Size: 759 Bytes

Versions: 13

Compression:

Stored size: 759 Bytes

Contents

require 'sample/hasprops'
require 'sample/group'
require 'sample/layer'
require 'sample/line'
require 'sample/shape'
require 'sample/oval'
require 'sample/rect'
require 'sample/text'
require 'sample/change'

module Sample
  class Doc
    include HasProps
    
    attr_accessor :title
    attr_accessor :create_time
    attr_accessor :user
    # Hash of layers in the document indexed by layer name.
    attr_reader :layers
    attr_reader :change_history

    def initialize(title)
      @title = title
      @user = ENV['USER']
      @create_time = Time.now
      @layers = { }
      @change_history = []
    end
    
    def add_change(comment, time=nil, user=nil)
      @change_history << Change.new(comment, time, user)
    end

  end # Doc
end # Sample

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
oj-3.16.9 test/sample/doc.rb
oj-3.16.8 test/sample/doc.rb
oj-3.16.7 test/sample/doc.rb
oj-3.16.6 test/sample/doc.rb
oj-3.16.5 test/sample/doc.rb
oj-3.16.4 test/sample/doc.rb
oj-3.16.3 test/sample/doc.rb
oj-3.16.2 test/sample/doc.rb
oj-3.16.1 test/sample/doc.rb
oj-3.16.0 test/sample/doc.rb
oj-3.15.1 test/sample/doc.rb
oj-3.15.0 test/sample/doc.rb
oj-3.14.3 test/sample/doc.rb