Sha256: 16e379d67ab626be4144e8c16aa1bd9b62617013b7697b6127b21b4bcd384ea5

Contents?: true

Size: 873 Bytes

Versions: 8

Compression:

Stored size: 873 Bytes

Contents

module Conglomerate
  class Command
    include Conglomerate::Particle

    attribute :href, :type => String, :required => true
    attribute :rel, :type => String, :required => true
    attribute :name, :type => String
    attribute :prompt, :type => String

    array :data, :contains => Datum
  end

  class CommandBuilder
    include Conglomerate::ParticleBuilder

    builds Conglomerate::Command

    module BuildOverride
      def build(attrs = {})
        instance_variable_set("@objects", nil)
        super(attrs.merge({
          :rel => _builder_name
        }))
      end
    end

    value :href
    value :rel
    value :name
    value :prompt

    builder :datum, Conglomerate::DatumBuilder, :name => :data, :array => true
  end
end

Conglomerate::CollectionBuilder.send(:builder, :command, Conglomerate::CommandBuilder, :name => :commands, :array => true)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
conglomerate-0.16.0 lib/conglomerate/ext/commands.rb
conglomerate-0.15.0 lib/conglomerate/ext/commands.rb
conglomerate-0.14.0 lib/conglomerate/ext/commands.rb
conglomerate-0.13.0 lib/conglomerate/ext/commands.rb
conglomerate-0.12.1 lib/conglomerate/ext/commands.rb
conglomerate-0.12.0 lib/conglomerate/ext/commands.rb
conglomerate-0.11.1 lib/conglomerate/ext/commands.rb
conglomerate-0.11.0 lib/conglomerate/ext/commands.rb