Class: Chef::Readbag::Bag

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-readbag/bag.rb

Instance Method Summary collapse

Constructor Details

#initialize(host_and_port, client_name, client_key_path) ⇒ Bag

Returns a new instance of Bag.



4
5
6
7
8
# File 'lib/chef-readbag/bag.rb', line 4

def initialize(host_and_port, client_name, client_key_path)
  @host_and_port   = host_and_port
  @client_name     = client_name
  @client_key_path = client_key_path
end

Instance Method Details

#[](bag_name) ⇒ Object



10
11
12
13
14
# File 'lib/chef-readbag/bag.rb', line 10

def [](bag_name)
  @bag_name = bag_name

  JSON.parse(RestClient.get(url, headers))
end