Class: ClarkKent::SharingScope
- Inherits:
-
Object
- Object
- ClarkKent::SharingScope
- Defined in:
- app/models/clark_kent/sharing_scope.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #dom_id ⇒ Object
- #human_name ⇒ Object
-
#initialize(record, parent) ⇒ SharingScope
constructor
A new instance of SharingScope.
- #reports ⇒ Object
Constructor Details
#initialize(record, parent) ⇒ SharingScope
Returns a new instance of SharingScope.
6 7 8 9 |
# File 'app/models/clark_kent/sharing_scope.rb', line 6 def initialize(record, parent) @record = record @parent = parent end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
4 5 6 |
# File 'app/models/clark_kent/sharing_scope.rb', line 4 def parent @parent end |
Instance Method Details
#dom_id ⇒ Object
11 12 13 14 15 |
# File 'app/models/clark_kent/sharing_scope.rb', line 11 def dom_id str = parent.type str += "_#{@record.id}" if @record.respond_to? :id str += "_reports" end |
#human_name ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/models/clark_kent/sharing_scope.rb', line 17 def human_name if @record.respond_to? :name @record.name else @record end end |