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, #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
# File 'lib/lucid_works/role.rb', line 20

def filters
  @attributes[:filters]
end

#filters=(val) ⇒ Object



47
48
49
# File 'lib/lucid_works/role.rb', line 47

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

#filters_for_text_areaObject



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

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



43
44
45
# File 'lib/lucid_works/role.rb', line 43

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

#groups_for_text_fieldObject



28
29
30
# File 'lib/lucid_works/role.rb', line 28

def groups_for_text_field
  @attributes[:groups].to_a.join(", ")
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



39
40
41
# File 'lib/lucid_works/role.rb', line 39

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

#users_for_text_fieldObject



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

def users_for_text_field
  @attributes[:users].to_a.join(", ")
end