Class: Hecks::Bluebook::StateTransition
- Inherits:
-
Object
- Object
- Hecks::Bluebook::StateTransition
- Defined in:
- lib/hecks/bluebook/lifecycle.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #constrained? ⇒ Boolean
-
#initialize(target:, from: nil) ⇒ StateTransition
constructor
A new instance of StateTransition.
Constructor Details
#initialize(target:, from: nil) ⇒ StateTransition
Returns a new instance of StateTransition.
8 9 10 11 12 13 14 15 |
# File 'lib/hecks/bluebook/lifecycle.rb', line 8 def initialize(target:, from: nil) @target = target.to_s @from = case from when Array then from.map(&:to_s) when nil then nil else from.to_s end end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
6 7 8 |
# File 'lib/hecks/bluebook/lifecycle.rb', line 6 def from @from end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
6 7 8 |
# File 'lib/hecks/bluebook/lifecycle.rb', line 6 def target @target end |
Instance Method Details
#constrained? ⇒ Boolean
17 |
# File 'lib/hecks/bluebook/lifecycle.rb', line 17 def constrained? = !@from.nil? |