Sha256: c8adf970aa1259a0c37ea15a9645ebfb7e451c043ac31c319403db4aeb0b94e8

Contents?: true

Size: 977 Bytes

Versions: 107

Compression:

Stored size: 977 Bytes

Contents

module RockRMS
  class Client
    module Attribute
      def list_attributes(options = {})
        Response::Attribute.format(
          get(attributes_path, options)
        )
      end

      def create_attribute(
        description: nil,
        field_type_id:,
        entity_type_id:,
        key:,
        name:,
        order: Random.rand(100..1000)
      )
        options = {
          'FieldTypeId'  => field_type_id,
          'EntityTypeId' => entity_type_id,
          'Key'          => key,
          'Name'         => name,
          'Description'  => description,
          'Order'        => order,

          # Required fields
          'IsSystem'     => false,
          'IsGridColumn' => false,
          'IsMultiValue' => false,
          'IsRequired'   => false,
          'AllowSearch'  => false
        }

        post(attributes_path, options)
      end

      private

      def attributes_path
        'Attributes'.freeze
      end
    end
  end
end

Version data entries

107 entries across 107 versions & 1 rubygems

Version Path
rock_rms-9.13.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.12.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.11.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.10.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.9.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.8.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.7.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.6.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.5.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.4.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.3.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.2.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.1.0 lib/rock_rms/resources/attribute.rb
rock_rms-9.0.0 lib/rock_rms/resources/attribute.rb
rock_rms-8.23.0 lib/rock_rms/resources/attribute.rb
rock_rms-8.22.0 lib/rock_rms/resources/attribute.rb
rock_rms-8.21.0 lib/rock_rms/resources/attribute.rb
rock_rms-8.20.0 lib/rock_rms/resources/attribute.rb
rock_rms-8.19.0 lib/rock_rms/resources/attribute.rb
rock_rms-8.18.0 lib/rock_rms/resources/attribute.rb