Module: Thwart::Actor::ClassMethods

Defined in:
lib/thwart/actor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_roleObject

Returns the value of attribute default_role.



8
9
10
# File 'lib/thwart/actor.rb', line 8

def default_role
  @default_role
end

#role_fromObject

Returns the value of attribute role_from.



8
9
10
# File 'lib/thwart/actor.rb', line 8

def role_from
  @role_from
end

Instance Method Details

#thwart_access(&block) ⇒ Object

Thwart enabling hook on actors



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/thwart/actor.rb', line 10

def thwart_access(&block)
  self.instance_eval do
    include Thwart::Cans
    include Thwart::Actor::InstanceMethods
  end
  # Set up DSL using dsl helper
  if block_given?
    dsl = Thwart::Dsl.new(:role_method => :role_from=, :role_proc => :role_from=, :role => :default_role=)
    dsl.evaluate(self, &block)
  end
end