Class: StrongConcerns::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/strong_concerns/reflection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mod, options) ⇒ Role

Returns a new instance of Role.



5
6
7
8
# File 'lib/strong_concerns/reflection.rb', line 5

def initialize(mod, options)
  @mod = mod
  @options = options
end

Instance Attribute Details

#modObject (readonly)

Returns the value of attribute mod.



3
4
5
# File 'lib/strong_concerns/reflection.rb', line 3

def mod
  @mod
end

Instance Method Details

#instance(subject) ⇒ Object



14
15
16
# File 'lib/strong_concerns/reflection.rb', line 14

def instance(subject)
  intermediate_class.new(subject, @options)
end

#intermediate_classObject



10
11
12
# File 'lib/strong_concerns/reflection.rb', line 10

def intermediate_class
  @intermediate_class ||= Intermediate.prepare(@mod)
end