class Contentful::Management::ClientEnvironmentMethodsFactory
Wrapper for Environment
API for usage from within Client
@private
Attributes
client[R]
Public Class Methods
new(client, space_id)
click to toggle source
# File lib/contentful/management/client_environment_methods_factory.rb, line 11 def initialize(client, space_id) @client = client @space_id = space_id @resource_requester = ResourceRequester.new(client, associated_class) end
Public Instance Methods
all()
click to toggle source
Gets a collection of environments.
@return [Contentful::Management::Array<Contentful::Management::Environment>]
# File lib/contentful/management/client_environment_methods_factory.rb, line 20 def all @resource_requester.all( space_id: @space_id ) end
associated_class()
click to toggle source
# File lib/contentful/management/client_environment_methods_factory.rb, line 54 def associated_class ::Contentful::Management::Environment end
create(attributes)
click to toggle source
Create an environment.
@param [Hash] attributes @option attributes [String] :name
@return [Contentful::Management::Environment]
# File lib/contentful/management/client_environment_methods_factory.rb, line 44 def create(attributes) associated_class.create(client, @space_id, attributes) end
find(environment_id)
click to toggle source
Gets a specific environment.
@param [String] environment_id
@return [Contentful::Management::Environment]
# File lib/contentful/management/client_environment_methods_factory.rb, line 31 def find(environment_id) @resource_requester.find( space_id: @space_id, environment_id: environment_id ) end
new()
click to toggle source
# File lib/contentful/management/client_environment_methods_factory.rb, line 48 def new object = associated_class.new object.client = client object end