Class: Lockdown::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/lockdown/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allowed_methodsObject

Returns the value of attribute allowed_methods.



3
4
5
# File 'lib/lockdown/context.rb', line 3

def allowed_methods
  @allowed_methods
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/lockdown/context.rb', line 3

def name
  @name
end

Instance Method Details

#allows?(method_name) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/lockdown/context.rb', line 9

def allows?(method_name)
  @allowed_methods.include?(method_name)
end

#to_sObject



5
6
7
# File 'lib/lockdown/context.rb', line 5

def to_s
  self.class.to_s
end