Module: Restfulie::Client::HTTP::RecipeModule

Included in:
EntryPoint, Recipe
Defined in:
lib/restfulie/client/entry_point.rb

Instance Method Summary collapse

Instance Method Details

#configuration_for(resource_name, configuration = Configuration.new) {|configuration| ... } ⇒ Object

Yields:

  • (configuration)


17
18
19
20
# File 'lib/restfulie/client/entry_point.rb', line 17

def configuration_for(resource_name,configuration = Configuration.new)
  yield configuration if block_given?
  @resources_configurations[resource_name] = configuration
end

#configuration_of(resource_name) ⇒ Object



13
14
15
# File 'lib/restfulie/client/entry_point.rb', line 13

def configuration_of(resource_name)
  @resources_configurations[resource_name]
end

#recipe(converter_sym, options = {}, &block) ⇒ Object



6
7
8
9
10
# File 'lib/restfulie/client/entry_point.rb', line 6

def recipe(converter_sym, options={}, &block)
  raise 'Undefined block' unless block_given?
  converter = "Tokamak::#{converter_sym.to_s.camelize}".constantize
  converter.describe_recipe(options[:name], &block) 
end

#retrieve(resource_name) ⇒ Object



22
23
24
25
26
27
# File 'lib/restfulie/client/entry_point.rb', line 22

def retrieve(resource_name)
  returning Object.new do |resource| 
    resource.extend(Base)
    resource.configure
  end
end