Class: SleipnirAPI::Profile::ProfileElement
- Inherits:
-
Object
- Object
- SleipnirAPI::Profile::ProfileElement
- Includes:
- DataUtil, OptionArgument
- Defined in:
- lib/sleipnir_api/profile/util.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(parent, default_opts) ⇒ ProfileElement
constructor
A new instance of ProfileElement.
- #inspect ⇒ Object
- #nodes ⇒ Object
- #parents ⇒ Object
Methods included from DataUtil
Methods included from OptionArgument
Methods included from OptionUtil
Constructor Details
#initialize(parent, default_opts) ⇒ ProfileElement
Returns a new instance of ProfileElement.
57 58 59 60 |
# File 'lib/sleipnir_api/profile/util.rb', line 57 def initialize(parent, default_opts) @parent = parent @default_opts = default_opts || {} end |
Instance Method Details
#inspect ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/sleipnir_api/profile/util.rb', line 70 def inspect args = [ self.class, object_id << 1, nodes.map{|e| e.name }.join("/"), @default_opts.inspect, ] "#<%s:0x%x: %s, opts=%s>" % args end |
#nodes ⇒ Object
66 67 68 |
# File 'lib/sleipnir_api/profile/util.rb', line 66 def nodes parents + [self] end |
#parents ⇒ Object
62 63 64 |
# File 'lib/sleipnir_api/profile/util.rb', line 62 def parents @parent.nil? ? [] : @parent.nodes end |