Class: Consent::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/consent/action.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, label, options = {}) ⇒ Action

Returns a new instance of Action.



7
8
9
10
11
# File 'lib/consent/action.rb', line 7

def initialize(key, label, options = {})
  @key = key
  @label = label
  @options = options
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/consent/action.rb', line 5

def key
  @key
end

#labelObject (readonly)

Returns the value of attribute label.



5
6
7
# File 'lib/consent/action.rb', line 5

def label
  @label
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/consent/action.rb', line 5

def options
  @options
end

Instance Method Details

#default_viewObject



17
18
19
# File 'lib/consent/action.rb', line 17

def default_view
  @options[:default_view]
end

#view_keysObject



13
14
15
# File 'lib/consent/action.rb', line 13

def view_keys
  @options.fetch(:views, [])
end