Class: Algolia::Search::Acl

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/models/search/acl.rb

Constant Summary collapse

ADD_OBJECT =
"addObject".freeze
ANALYTICS =
"analytics".freeze
BROWSE =
"browse".freeze
DELETE_OBJECT =
"deleteObject".freeze
DELETE_INDEX =
"deleteIndex".freeze
EDIT_SETTINGS =
"editSettings".freeze
INFERENCE =
"inference".freeze
LIST_INDEXES =
"listIndexes".freeze
LOGS =
"logs".freeze
PERSONALIZATION =
"personalization".freeze
RECOMMENDATION =
"recommendation".freeze
SEARCH =
"search".freeze
SEE_UNRETRIEVABLE_ATTRIBUTES =
"seeUnretrievableAttributes".freeze
SETTINGS =
"settings".freeze
USAGE =
"usage".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/algolia/models/search/acl.rb', line 25

def self.all_vars
  @all_vars ||= [
    ADD_OBJECT,
    ANALYTICS,
    BROWSE,
    DELETE_OBJECT,
    DELETE_INDEX,
    EDIT_SETTINGS,
    INFERENCE,
    LIST_INDEXES,
    LOGS,
    PERSONALIZATION,
    RECOMMENDATION,
    SEARCH,
    SEE_UNRETRIEVABLE_ATTRIBUTES,
    SETTINGS,
    USAGE
  ].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



48
49
50
# File 'lib/algolia/models/search/acl.rb', line 48

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



55
56
57
58
# File 'lib/algolia/models/search/acl.rb', line 55

def build_from_hash(value)
  return value if Acl.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #Acl"
end