Class: Salesforce::Types::FieldLevelSecurity
- Inherits:
-
Object
- Object
- Salesforce::Types::FieldLevelSecurity
- Includes:
- ROXML
- Defined in:
- lib/mdata/types/FieldLevelSecurity.rb
Overview
A generic FieldLevelSecurity class that can be extended for specific metadata objects, e.g. ProfileFieldLevelSecurity.
Direct Known Subclasses
Instance Method Summary collapse
-
#get_permissions ⇒ Array
Get all the permissions granted as an easy-to-use Array.
-
#to_flag_style ⇒ String
Produces a string representation of the permissions suitable for displaying in a list, à la ‘ls -la`.
-
#to_s ⇒ String
Get a string representation of the permissions.
Instance Method Details
#get_permissions ⇒ Array
Get all the permissions granted as an easy-to-use Array
22 23 24 25 26 27 28 |
# File 'lib/mdata/types/FieldLevelSecurity.rb', line 22 def = Array.new .push 'Editable' if @editable == 'true' .push 'Hidden' if @hidden == 'true' .push 'Readable' if @readable == 'true' end |
#to_flag_style ⇒ String
Produces a string representation of the permissions suitable for displaying in a list, à la ‘ls -la`. The resulting list might look something like this:
Readable Editable
Hidden
Readable
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mdata/types/FieldLevelSecurity.rb', line 48 def to_flag_style flags = '' if @readable == 'true' flags += 'Readable ' else flags += ' ' end if @editable == 'true' flags += 'Editable ' else flags += ' ' end if @hidden == 'true' flags += 'Hidden' else flags += ' ' end flags end |
#to_s ⇒ String
Get a string representation of the permissions
34 35 36 |
# File 'lib/mdata/types/FieldLevelSecurity.rb', line 34 def to_s .join(', ') end |