Class: Graphomaton::Transition
- Inherits:
-
Data
- Object
- Data
- Graphomaton::Transition
- Defined in:
- lib/graphomaton/model.rb,
sig/graphomaton.rbs
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#line_style ⇒ Object
readonly
Returns the value of attribute line_style.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(id:, from:, to:, label:, style:, metadata:, line_style:) ⇒ Transition
constructor
A new instance of Transition.
- #to_h ⇒ Object
Constructor Details
#initialize(id:, from:, to:, label:, style:, metadata:, line_style:) ⇒ Transition
Returns a new instance of Transition.
152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/graphomaton/model.rb', line 152 def initialize(id:, from:, to:, label:, style:, metadata:, line_style:) super( id: id, from: ModelValue.copy(from), to: ModelValue.copy(to), label: ModelValue.copy(label), style: ModelValue.copy(style), metadata: ModelValue.copy(), line_style: ModelValue.copy(line_style) ) end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from
151 152 153 |
# File 'lib/graphomaton/model.rb', line 151 def from @from end |
#id ⇒ Object (readonly)
Returns the value of attribute id
151 152 153 |
# File 'lib/graphomaton/model.rb', line 151 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label
151 152 153 |
# File 'lib/graphomaton/model.rb', line 151 def label @label end |
#line_style ⇒ Object (readonly)
Returns the value of attribute line_style
151 152 153 |
# File 'lib/graphomaton/model.rb', line 151 def line_style @line_style end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
151 152 153 |
# File 'lib/graphomaton/model.rb', line 151 def @metadata end |
#style ⇒ Object (readonly)
Returns the value of attribute style
151 152 153 |
# File 'lib/graphomaton/model.rb', line 151 def style @style end |
#to ⇒ Object (readonly)
Returns the value of attribute to
151 152 153 |
# File 'lib/graphomaton/model.rb', line 151 def to @to end |
Instance Method Details
#[](key) ⇒ Object
164 165 166 167 168 |
# File 'lib/graphomaton/model.rb', line 164 def [](key) public_send(key) rescue NoMethodError nil end |
#to_h ⇒ Object
170 171 172 173 174 175 176 |
# File 'lib/graphomaton/model.rb', line 170 def to_h output = { from: from, to: to, label: label.is_a?(Label) ? label.to_s : label } output[:style] = style unless style.nil? output[:metadata] = unless .nil? output[:line_style] = line_style unless line_style.nil? output end |