Sha256: 5c6b08d3ff3b9d78d043de4cd74c4e412d41f3e3b985ae6600860f23e131dcf3

Contents?: true

Size: 1.36 KB

Versions: 15

Compression:

Stored size: 1.36 KB

Contents

module Neuron
  module Schema
    class BlockedUserAgent
      include Common

      SCHEMA = self.new
      
      def index
        @@index ||=
        set_of(object_type("blocked_user_agent",
          :id => id,
          :description => description,
          :user_agent => user_agent
        ))
      end

      def create
        @@create ||=
        object_type("blocked_user_agent",
          :description => description(:required => false),
          :user_agent => user_agent
        )
      end

      def show
        @@show ||=
        object_type("blocked_user_agent",
          :id => id,
          :description => description,
          :user_agent => user_agent,
          :created_at => datetime,
          :updated_at => datetime
        )
      end

      def update
        @@update ||=
        object_type("blocked_user_agent",
          :id => id,
          :description => description(:required => false),
          :user_agent => user_agent(:required => false)
        )
      end

      private

      def description(overrides={})
        merged({
          :type => %w(string null),
          :maxLength => 255,
          :required => true
        }, overrides)
      end

      def user_agent(overrides={})
        merged({
          :type => "string",
          :format => "regex",
          :required => true
        }, overrides)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
neuron-client-0.6.0 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.5.3 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.5.2 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.5.1 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.5.0 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.8 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.7 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.6 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.5 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.4 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.3 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.2 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.1 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.4.0 lib/neuron-client/schema/blocked_user_agent.rb
neuron-client-0.3.0 lib/neuron-client/schema/blocked_user_agent.rb