Class: StrongConcerns::Role
- Inherits:
-
Object
- Object
- StrongConcerns::Role
- Defined in:
- lib/strong_concerns/reflection.rb
Instance Attribute Summary collapse
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
Instance Method Summary collapse
-
#initialize(mod, options) ⇒ Role
constructor
A new instance of Role.
- #instance(subject) ⇒ Object
- #intermediate_class ⇒ Object
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, ) @mod = mod @options = end |
Instance Attribute Details
#mod ⇒ Object (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_class ⇒ Object
10 11 12 |
# File 'lib/strong_concerns/reflection.rb', line 10 def intermediate_class @intermediate_class ||= Intermediate.prepare(@mod) end |