Class: Twb::Graph
- Inherits:
-
Object
- Object
- Twb::Graph
- Defined in:
- lib/twb/graph.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #dotLabel ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name:, id:, type:, properties: {}) ⇒ Graph
constructor
A new instance of Graph.
- #to_s ⇒ Object
Constructor Details
#initialize(name:, id:, type:, properties: {}) ⇒ Graph
Returns a new instance of Graph.
27 28 29 30 31 32 |
# File 'lib/twb/graph.rb', line 27 def initialize (name:, id:, type:, properties: {}) @name = name @id = id @type = type @properties = properties end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
23 24 25 |
# File 'lib/twb/graph.rb', line 23 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/twb/graph.rb', line 23 def name @name end |
#properties ⇒ Object
Returns the value of attribute properties.
24 25 26 |
# File 'lib/twb/graph.rb', line 24 def properties @properties end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
23 24 25 |
# File 'lib/twb/graph.rb', line 23 def type @type end |
Instance Method Details
#dotLabel ⇒ Object
34 35 36 37 |
# File 'lib/twb/graph.rb', line 34 def dotLabel # "JIRA 1::JIRA 1.csv" [label="JIRA 1.csv"] "\"%s\" [label=\"%s\"]" % [id, name] end |
#eql?(other) ⇒ Boolean
39 40 41 |
# File 'lib/twb/graph.rb', line 39 def eql? other @name == other.name && @id == other.id && @type == other.type && @properties == other.properties end |
#hash ⇒ Object
43 44 45 |
# File 'lib/twb/graph.rb', line 43 def hash [@name, @id, @type, @properties].hash end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/twb/graph.rb', line 47 def to_s "name:'%s' id:'%s' t:'%s' p:'%s'" % [@name, @id, @type, @properties.to_s] end |