Class: AdequateExposure::Context
- Inherits:
-
Object
- Object
- AdequateExposure::Context
- Defined in:
- lib/adequate_exposure/context.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(context, attribute) ⇒ Context
constructor
A new instance of Context.
- #set(value) ⇒ Object
Constructor Details
#initialize(context, attribute) ⇒ Context
Returns a new instance of Context.
5 6 7 |
# File 'lib/adequate_exposure/context.rb', line 5 def initialize(context, attribute) @context, @attribute = context, attribute end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
3 4 5 |
# File 'lib/adequate_exposure/context.rb', line 3 def attribute @attribute end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/adequate_exposure/context.rb', line 3 def context @context end |
Instance Method Details
#get ⇒ Object
9 10 11 |
# File 'lib/adequate_exposure/context.rb', line 9 def get ivar_defined?? ivar_get : set(fetch_value) end |
#set(value) ⇒ Object
13 14 15 |
# File 'lib/adequate_exposure/context.rb', line 13 def set(value) ivar_set(value) end |