Class: OSX::ACL::Entry
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #assignment ⇒ Object
- #assignment_components ⇒ Object
- #inherited=(should_inherit) ⇒ Object
- #inherited? ⇒ Boolean
- #orphaned? ⇒ Boolean
- #permissions ⇒ Object
- #rules ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
6 7 8 |
# File 'lib/acl/entry.rb', line 6 def components @components end |
Class Method Details
.from_text(text) ⇒ Object
8 9 10 |
# File 'lib/acl/entry.rb', line 8 def self.from_text(text) new.tap {|entry| entry.components = text.split(":") } end |
Instance Method Details
#<=>(other) ⇒ Object
12 13 14 |
# File 'lib/acl/entry.rb', line 12 def <=>(other) components <=> other.components end |
#assignment ⇒ Object
36 37 38 |
# File 'lib/acl/entry.rb', line 36 def assignment ACL::Assignment.new(assignment_components) end |
#assignment_components ⇒ Object
40 41 42 |
# File 'lib/acl/entry.rb', line 40 def assignment_components components[0..-3] end |
#inherited=(should_inherit) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/acl/entry.rb', line 20 def inherited=(should_inherit) if should_inherit && !inherited? rules << "inherited" elsif inherited? && !should_inherit rules.delete("inherited") end end |
#inherited? ⇒ Boolean
28 29 30 |
# File 'lib/acl/entry.rb', line 28 def inherited? rules.include? "inherited" end |
#orphaned? ⇒ Boolean
32 33 34 |
# File 'lib/acl/entry.rb', line 32 def orphaned? assignment.orphan? end |
#permissions ⇒ Object
44 45 46 |
# File 'lib/acl/entry.rb', line 44 def components.last.split(",") end |
#rules ⇒ Object
48 49 50 |
# File 'lib/acl/entry.rb', line 48 def rules components[-2].split(",") end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/acl/entry.rb', line 16 def to_s components.join(":") end |