Class: DemoMode::Persona::Variant
- Inherits:
-
Struct
- Object
- Struct
- DemoMode::Persona::Variant
- Defined in:
- lib/demo_mode/persona.rb
Instance Attribute Summary collapse
-
#at_claim_callback ⇒ Object
readonly
Returns the value of attribute at_claim_callback.
-
#signinable_generator ⇒ Object
readonly
Returns the value of attribute signinable_generator.
Instance Method Summary collapse
- #at_claim(&block) ⇒ Object
- #enabled(&block) ⇒ Object
- #enabled? ⇒ Boolean
- #sign_in_as(&signinable_generator) ⇒ Object
- #title ⇒ Object
Instance Attribute Details
#at_claim_callback ⇒ Object (readonly)
Returns the value of attribute at_claim_callback.
175 176 177 |
# File 'lib/demo_mode/persona.rb', line 175 def at_claim_callback @at_claim_callback end |
#signinable_generator ⇒ Object (readonly)
Returns the value of attribute signinable_generator.
176 177 178 |
# File 'lib/demo_mode/persona.rb', line 176 def signinable_generator @signinable_generator end |
Instance Method Details
#at_claim(&block) ⇒ Object
167 168 169 |
# File 'lib/demo_mode/persona.rb', line 167 def at_claim(&block) @at_claim_callback = block end |
#enabled(&block) ⇒ Object
159 160 161 |
# File 'lib/demo_mode/persona.rb', line 159 def enabled(&block) @enabled_condition = block end |
#enabled? ⇒ Boolean
163 164 165 |
# File 'lib/demo_mode/persona.rb', line 163 def enabled? @enabled_condition ? @enabled_condition.call : true end |
#sign_in_as(&signinable_generator) ⇒ Object
155 156 157 |
# File 'lib/demo_mode/persona.rb', line 155 def sign_in_as(&signinable_generator) @signinable_generator = signinable_generator end |
#title ⇒ Object
171 172 173 |
# File 'lib/demo_mode/persona.rb', line 171 def title name.is_a?(Symbol) ? name.to_s.titleize : name.to_s end |