Class: LucidWorks::Role

Inherits:
Base
  • Object
show all
Defined in:
lib/lucid_works/role.rb

Constant Summary

Constants included from Utils::BoolConverter

Utils::BoolConverter::FALSE_VALUES, Utils::BoolConverter::TRUE_VALUES

Instance Attribute Summary

Attributes inherited from Base

#attributes, #id, #parent, #persisted, #raw_response, #response_data

Instance Method Summary collapse

Methods inherited from Base

all, #collection_url, collection_url, create, #destroy, extract_parent_from_options, find, first, human_attribute_value, #human_attribute_value, #initialize, #inspect, last, #member_url, #persisted?, #read_attribute_for_validation, #save, schema, singleton_name, to_select, #update_attributes

Methods included from SimpleNaming

#model_name

Methods included from Utils::BoolConverter

#to_bool

Constructor Details

This class inherits a constructor from LucidWorks::Base

Instance Method Details

#filtersObject



20
21
22
23
# File 'lib/lucid_works/role.rb', line 20

def filters
  # require 'ruby-debug'; debugger
  @attributes[:filters]
end

#filters=(val) ⇒ Object



40
41
42
43
44
# File 'lib/lucid_works/role.rb', line 40

def filters=(val)
  @attributes[:filters] = string_or_array(val, /\r+/) rescue "Can't interpret #{val.class} as list of groups"
  # require 'ruby-debug'; debugger
  # @attributes[:filters]
end

#filters_for_text_areaObject



25
26
27
# File 'lib/lucid_works/role.rb', line 25

def filters_for_text_area
  @attributes[:filters].to_a.join("\n")
end

#groupsObject



16
17
18
# File 'lib/lucid_works/role.rb', line 16

def groups
  @attributes[:groups]
end

#groups=(val) ⇒ Object



36
37
38
# File 'lib/lucid_works/role.rb', line 36

def groups=(val)
  @attributes[:groups] = string_or_array(val, /[\s,]+/) rescue "Can't interpret #{val.class} as list of groups"
end

#usersObject



12
13
14
# File 'lib/lucid_works/role.rb', line 12

def users
  @attributes[:users]
end

#users=(val) ⇒ Object

Accept a comma or space separated list of users, convert to array



32
33
34
# File 'lib/lucid_works/role.rb', line 32

def users=(val)
  @attributes[:users] = string_or_array(val, /[\s,]+/) rescue "Can't interpret #{val.class} as list of users"
end