Class: Consent::Action
- Inherits:
-
Object
- Object
- Consent::Action
- Defined in:
- lib/consent/action.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
- #default_view ⇒ Object
-
#initialize(subject, key, label, options = {}) ⇒ Action
constructor
A new instance of Action.
- #views ⇒ Object
Constructor Details
#initialize(subject, key, label, options = {}) ⇒ Action
Returns a new instance of Action.
7 8 9 10 11 12 |
# File 'lib/consent/action.rb', line 7 def initialize(subject, key, label, = {}) @subject = subject @key = key @label = label = end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/consent/action.rb', line 5 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/consent/action.rb', line 5 def label @label end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/consent/action.rb', line 5 def end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
5 6 7 |
# File 'lib/consent/action.rb', line 5 def subject @subject end |
Instance Method Details
#default_view ⇒ Object
18 19 20 21 22 |
# File 'lib/consent/action.rb', line 18 def default_view return unless .key?(:default_view) @default_view ||= @subject.views[[:default_view]] end |
#views ⇒ Object
14 15 16 |
# File 'lib/consent/action.rb', line 14 def views @views ||= @subject.views.slice(*.fetch(:views, [])) end |