Class: Google::Compute::Data::RegioSelfLinkRefCatalog
- Inherits:
-
RegioSelfLinkRef
- Object
- RegioSelfLinkRef
- Google::Compute::Data::RegioSelfLinkRefCatalog
- Defined in:
- lib/google/compute/property/region_selflink.rb
Overview
A class to fetch the resource value from a referenced block Will return the value exported from a different Puppet resource
Instance Method Summary collapse
-
#autorequires ⇒ Object
Puppet requires the title for autorequiring.
-
#initialize(title) ⇒ RegioSelfLinkRefCatalog
constructor
A new instance of RegioSelfLinkRefCatalog.
- #resource ⇒ Object
- #to_json(_arg = nil) ⇒ Object
- #to_s ⇒ Object
Methods inherited from RegioSelfLinkRef
Constructor Details
#initialize(title) ⇒ RegioSelfLinkRefCatalog
Returns a new instance of RegioSelfLinkRefCatalog.
53 54 55 |
# File 'lib/google/compute/property/region_selflink.rb', line 53 def initialize(title) @title = title end |
Instance Method Details
#autorequires ⇒ Object
Puppet requires the title for autorequiring
58 59 60 |
# File 'lib/google/compute/property/region_selflink.rb', line 58 def autorequires [@title] end |
#resource ⇒ Object
71 72 73 74 75 76 |
# File 'lib/google/compute/property/region_selflink.rb', line 71 def resource Google::ObjectStore.instance[:gcompute_region].each do |entry| return entry.exports[:self_link] if entry.title == @title end raise ArgumentError, "gcompute_region[#{@title}] required" end |
#to_json(_arg = nil) ⇒ Object
66 67 68 69 |
# File 'lib/google/compute/property/region_selflink.rb', line 66 def to_json(_arg = nil) return if resource.nil? resource.to_json end |
#to_s ⇒ Object
62 63 64 |
# File 'lib/google/compute/property/region_selflink.rb', line 62 def to_s resource.to_s end |