Sha256: fc86bda068c95229d4deb7ec60d145b52a2d909e5d50e4a0a941177bdd723fe2

Contents?: true

Size: 719 Bytes

Versions: 5

Compression:

Stored size: 719 Bytes

Contents

module Scide

  class Project
    attr_accessor :properties, :options, :path

    def initialize contents, key, global
      @global = global

      @path = contents[:path].try(:to_s) || key.to_s
      @path = File.join global.path, @path unless @path.match /^\//

      @properties = global.properties.merge(contents[:properties] || {})
      @properties['name'] ||= key

      @options = global.options.merge(contents[:options] || {})

      @windows = []
      contents[:windows].each do |w|
        @windows << Scide::Window.new(w, self)
      end
    end

    def to_screen
      String.new.tap do |s|
        @windows.each_with_index do |w,i|
          s << w.to_screen(i)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scide-0.0.5 lib/scide/project.rb
scide-0.0.4 lib/scide/project.rb
scide-0.0.3 lib/scide/project.rb
scide-0.0.2 lib/scide/project.rb
scide-0.0.1 lib/scide/project.rb