Sha256: ba23aa60a80384c3bb94c7196fe5848b5161e7f3a930de88660b9e1d0226cbc5

Contents?: true

Size: 600 Bytes

Versions: 2

Compression:

Stored size: 600 Bytes

Contents

module Vedeu
  module API
    class Composition < Vedeu::Composition
      def self.build(&block)
        new(&block).attributes
      end

      def initialize(&block)
        super

        if block_given?
          @self_before_instance_eval = eval('self', block.binding)

          instance_eval(&block)
        end
      end

      def view(name, &block)
        attributes[:interfaces] << Interface.build({ name: name }, &block)
      end

      private

      def method_missing(method, *args, &block)
        @self_before_instance_eval.send(method, *args, &block)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.1.15 lib/vedeu/api/composition.rb
vedeu-0.1.14 lib/vedeu/api/composition.rb