Sha256: d2b8dcaaf1cacb27332f4bdacdcad838ec0da19721b8d0483b0265fa04b5563f

Contents?: true

Size: 648 Bytes

Versions: 7

Compression:

Stored size: 648 Bytes

Contents

class Lbrt::Space::DSL::Context::Space
  include Lbrt::Utils::TemplateHelper

  def initialize(context, name_or_id, &block)
    @context = context.merge(:space_name => name_or_id)
    @name_or_id = name_or_id
    @result = {'charts' => {}}
    instance_eval(&block)
  end

  attr_reader :result
  attr_reader :context

  private

  def chart(chart_name_or_id, &block)
    if @result[chart_name_or_id]
      raise "Space `#{@name_or_id}` > Chart `#{chart_name_or_id}` is already defined"
    end

    @result['charts'][chart_name_or_id] = Lbrt::Space::DSL::Context::Space::Chart.new(@context, @name_or_id, chart_name_or_id, &block).result
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lbrt-0.2.1 lib/lbrt/space/dsl/context/space.rb
lbrt-0.2.0 lib/lbrt/space/dsl/context/space.rb
lbrt-0.1.9 lib/lbrt/space/dsl/context/space.rb
lbrt-0.1.8 lib/lbrt/space/dsl/context/space.rb
lbrt-0.1.7 lib/lbrt/space/dsl/context/space.rb
lbrt-0.1.6 lib/lbrt/space/dsl/context/space.rb
lbrt-0.1.5 lib/lbrt/space/dsl/context/space.rb