Sha256: 73e827162d20379ef3dadd8ac645d90520afb12e7f90c9933b1f3e330e8e6dd7

Contents?: true

Size: 684 Bytes

Versions: 11

Compression:

Stored size: 684 Bytes

Contents

module GroupDocs
  module Api
    module Helpers
      module AccessMode

        MODES = {
          private:    0,
          restricted: 1,
          public:     2
        }

        private

        #
        # Converts access mode from/to human-readable format.
        #
        # @param [Integer, Symbol] mode
        # @return [Symbol, Integer]
        # @api private
        #
        def parse_access_mode(mode)
          if mode.is_a?(Integer)
            MODES.invert[mode]
          else
            MODES[mode]
          end or raise ArgumentError, "Unknown access mode: #{mode.inspect}."
        end

      end # AccessMode
    end # Helpers
  end # Api
end # GroupDocs

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
groupdocs-0.2.11 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.10 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.9 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.8 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.7 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.6 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.5 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.4 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.3 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.2 lib/groupdocs/api/helpers/access_mode_helper.rb
groupdocs-0.2.1 lib/groupdocs/api/helpers/access_mode_helper.rb