Sha256: e44adbb0db529dc8f20c7fb34d27f2bc63a2a16c28f86a22f173237d7932b5da

Contents?: true

Size: 774 Bytes

Versions: 22

Compression:

Stored size: 774 Bytes

Contents

module Vedeu

  module DSL

    # Provides methods to be used to define views.
    #
    class Stream

      include Vedeu::DSL
      include Vedeu::DSL::Presentation
      include Vedeu::DSL::Text

      # @param block [Proc]
      # @raise [Vedeu::Error::RequiresBlock]
      # @return [void]
      def stream(&block)
        fail Vedeu::Error::RequiresBlock unless block_given?

        model.add(model.class.build(attributes, &block))
      end

      private

      # Returns the default attributes for the new model.
      #
      # Overrides {Vedeu::DSL#attributes}.
      #
      # @return [Hash<Symbol => void>]
      def attributes
        {
          client: client,
          parent: model.parent,
        }
      end

    end # Stream

  end # DSL

end # Vedeu

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
vedeu-0.7.4 lib/vedeu/dsl/stream.rb
vedeu-0.7.3 lib/vedeu/dsl/stream.rb
vedeu-0.7.2 lib/vedeu/dsl/stream.rb
vedeu-0.7.1 lib/vedeu/dsl/stream.rb
vedeu-0.7.0 lib/vedeu/dsl/stream.rb
vedeu-0.6.71 lib/vedeu/dsl/stream.rb
vedeu-0.6.70 lib/vedeu/dsl/stream.rb
vedeu-0.6.69 lib/vedeu/dsl/stream.rb
vedeu-0.6.68 lib/vedeu/dsl/stream.rb
vedeu-0.6.67 lib/vedeu/dsl/stream.rb
vedeu-0.6.66 lib/vedeu/dsl/stream.rb
vedeu-0.6.65 lib/vedeu/dsl/stream.rb
vedeu-0.6.64 lib/vedeu/dsl/stream.rb
vedeu-0.6.63 lib/vedeu/dsl/stream.rb
vedeu-0.6.62 lib/vedeu/dsl/stream.rb
vedeu-0.6.61 lib/vedeu/dsl/stream.rb
vedeu-0.6.60 lib/vedeu/dsl/stream.rb
vedeu-0.6.59 lib/vedeu/dsl/stream.rb
vedeu-0.6.58 lib/vedeu/dsl/stream.rb
vedeu-0.6.57 lib/vedeu/dsl/stream.rb