Class: RailsFlowMap::FlowNode
- Inherits:
-
Object
- Object
- RailsFlowMap::FlowNode
- Defined in:
- lib/rails_flow_map/models/flow_node.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#id ⇒ Object
Returns the value of attribute id.
-
#line_number ⇒ Object
Returns the value of attribute line_number.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #action? ⇒ Boolean
- #controller? ⇒ Boolean
-
#initialize(id:, name:, type:, attributes: {}, file_path: nil, line_number: nil) ⇒ FlowNode
constructor
A new instance of FlowNode.
- #model? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(id:, name:, type:, attributes: {}, file_path: nil, line_number: nil) ⇒ FlowNode
5 6 7 8 9 10 11 12 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 5 def initialize(id:, name:, type:, attributes: {}, file_path: nil, line_number: nil) @id = id @name = name @type = type @attributes = attributes @file_path = file_path @line_number = line_number end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 3 def attributes @attributes end |
#file_path ⇒ Object
Returns the value of attribute file_path.
3 4 5 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 3 def file_path @file_path end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 3 def id @id end |
#line_number ⇒ Object
Returns the value of attribute line_number.
3 4 5 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 3 def line_number @line_number end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 3 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 3 def type @type end |
Instance Method Details
#action? ⇒ Boolean
22 23 24 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 22 def action? type == :action end |
#controller? ⇒ Boolean
18 19 20 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 18 def controller? type == :controller end |
#model? ⇒ Boolean
14 15 16 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 14 def model? type == :model end |
#to_h ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rails_flow_map/models/flow_node.rb', line 26 def to_h { id: id, name: name, type: type, attributes: attributes, file_path: file_path, line_number: line_number } end |