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.
164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/graphomaton/model.rb', line 164 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
163 164 165 |
# File 'lib/graphomaton/model.rb', line 163 def from @from end |
#id ⇒ Object (readonly)
Returns the value of attribute id
163 164 165 |
# File 'lib/graphomaton/model.rb', line 163 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label
163 164 165 |
# File 'lib/graphomaton/model.rb', line 163 def label @label end |
#line_style ⇒ Object (readonly)
Returns the value of attribute line_style
163 164 165 |
# File 'lib/graphomaton/model.rb', line 163 def line_style @line_style end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
163 164 165 |
# File 'lib/graphomaton/model.rb', line 163 def end |
#style ⇒ Object (readonly)
Returns the value of attribute style
163 164 165 |
# File 'lib/graphomaton/model.rb', line 163 def style @style end |
#to ⇒ Object (readonly)
Returns the value of attribute to
163 164 165 |
# File 'lib/graphomaton/model.rb', line 163 def to @to end |
Instance Method Details
#[](key) ⇒ Object
176 177 178 179 180 |
# File 'lib/graphomaton/model.rb', line 176 def [](key) public_send(key) rescue NoMethodError nil end |
#to_h ⇒ Object
182 183 184 185 186 187 188 |
# File 'lib/graphomaton/model.rb', line 182 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 |