Class: Ec2Metadata::Root

Inherits:
Base
  • Object
show all
Defined in:
lib/ec2_metadata/root.rb

Instance Attribute Summary

Attributes inherited from Base

#default_child_key, #path

Instance Method Summary collapse

Methods inherited from Base

#child_keys, #children, #default_child, #from_hash, #get, #is_child_key?, #to_hash

Constructor Details

#initialize(path = '/') ⇒ Root

Returns a new instance of Root.



5
6
7
8
# File 'lib/ec2_metadata/root.rb', line 5

def initialize(path = '/')
  @path = path
  @default_child_key = 'latest'
end

Instance Method Details

#is_struct?(child_key) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ec2_metadata/root.rb', line 16

def is_struct?(child_key)
  true
end

#new_child(child_key) ⇒ Object



10
11
12
13
14
# File 'lib/ec2_metadata/root.rb', line 10

def new_child(child_key)
  logging("new_child(#{child_key.inspect})") do
    Revision.new("#{path}#{child_key}/")
  end
end