Module: Ridley::DSL
- Included in:
- Connection
- Defined in:
- lib/ridley/dsl.rb,
lib/ridley/resources/node.rb,
lib/ridley/resources/role.rb,
lib/ridley/resources/client.rb,
lib/ridley/resources/search.rb,
lib/ridley/resources/sandbox.rb,
lib/ridley/resources/cookbook.rb,
lib/ridley/resources/data_bag.rb,
lib/ridley/resources/environment.rb
Overview
A DSL to be included into Ridley::Connection. Instance functions of the same name as Chef a resource are coerced into class functions of a class of the same name.
This is accomplished by returning a Ridley::Context object and coercing any messages sent to it into a message to the Chef resource’s class in Ridley.
Instance Method Summary collapse
-
#client ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Client.
-
#cookbook ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Cookbook.
-
#data_bag ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::DataBag.
-
#environment ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Environment.
-
#node ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Node.
-
#role ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Role.
-
#sandbox ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Sandbox.
-
#search(index, query = nil, options = {}) ⇒ Hash
Creates an runs a new Ridley::Search.
-
#search_indexes ⇒ Array<Symbol, String>
Return the array of all possible search indexes for the including connection.
Instance Method Details
#client ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Client. This coercion sends an instance of the including class along to the class function.
71 72 73 |
# File 'lib/ridley/resources/client.rb', line 71 def client Context.new(Ridley::Client, self) end |
#cookbook ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Cookbook. This coercion sends an instance of the including class along to the class function.
49 50 51 |
# File 'lib/ridley/resources/cookbook.rb', line 49 def cookbook Context.new(Ridley::Cookbook, self) end |
#data_bag ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::DataBag. This coercion sends an instance of the including class along to the class function.
71 72 73 |
# File 'lib/ridley/resources/data_bag.rb', line 71 def data_bag Context.new(Ridley::DataBag, self) end |
#environment ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Environment. This coercion sends an instance of the including class along to the class function.
91 92 93 |
# File 'lib/ridley/resources/environment.rb', line 91 def environment Context.new(Ridley::Environment, self) end |
#node ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Node. This coercion sends an instance of the including class along to the class function.
145 146 147 |
# File 'lib/ridley/resources/node.rb', line 145 def node Context.new(Ridley::Node, self) end |
#role ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Role. This coercion sends an instance of the including class along to the class function.
75 76 77 |
# File 'lib/ridley/resources/role.rb', line 75 def role Context.new(Ridley::Role, self) end |
#sandbox ⇒ Ridley::Context
Coerces instance functions into class functions on Ridley::Sandbox. This coercion sends an instance of the including class along to the class function.
118 119 120 |
# File 'lib/ridley/resources/sandbox.rb', line 118 def sandbox Context.new(Ridley::Sandbox, self) end |
#search(index, query = nil, options = {}) ⇒ Hash
Creates an runs a new Ridley::Search
116 117 118 |
# File 'lib/ridley/resources/search.rb', line 116 def search(index, query = nil, = {}) Search.new(self, index, query, ).run end |
#search_indexes ⇒ Array<Symbol, String>
Return the array of all possible search indexes for the including connection
128 129 130 |
# File 'lib/ridley/resources/search.rb', line 128 def search_indexes Search.indexes(self) end |