Class: ConfCtl::Swpins::DeployedInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/confctl/swpins/deployed_info.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ DeployedInfo

Returns a new instance of DeployedInfo.



15
16
17
# File 'lib/confctl/swpins/deployed_info.rb', line 15

def initialize(hash)
  @swpins = hash
end

Instance Attribute Details

#swpinsHash (readonly)

Returns:

  • (Hash)


13
14
15
# File 'lib/confctl/swpins/deployed_info.rb', line 13

def swpins
  @swpins
end

Class Method Details

.parse!(json) ⇒ Object

Parameters:

  • json (String)


6
7
8
9
10
# File 'lib/confctl/swpins/deployed_info.rb', line 6

def self.parse!(json)
  new(JSON.parse(json))
rescue JSON::ParserError => e
  raise Error, "unable to parse swpins info: #{e.message}"
end

Instance Method Details

#[](swpin) ⇒ Object



19
20
21
# File 'lib/confctl/swpins/deployed_info.rb', line 19

def [](swpin)
  swpins[swpin]
end