b0VIM 7.3#"SKnOblankhank.contentful.com~blank/git/contentful.rb/README.md 3210#"! Utp^__ad^MLCB"!    K u t [ @ ? l k j ` _ ^ ( ' v Z / . - c@?wq#z^### Assets happycat.fields[:image].resolve # => # #"Link", :linkType=>"Asset", :id=>"happycat"}> happycat.fields[:image] happycat = client.entry 'happycat'You can easily request a resource that is represented by a link by calling `#resolve`:### LinksArrays also have a `#next_page` URL, which will rerun the request with a increased skip parameter, as described in [the documentation](https://www.contentful.com/developers/documentation/content-delivery-api/#search-limit).Contentful::Array has an `#each` method that delegates to its items. It also includes Ruby's Enumerable module, providing methods like `#min` or `#first`. See the Ruby core documentation for further details.### ArraysThe `:auto` mode will fetch all content types on initialization. If you want to do it by hand later, you will need to set the option to `:manual` and call `client.update_dynamic_entry_cache!` to initialize all dynamic entries.Dynamic entries will have getter classes for the fields and do type conversions properly. entry.color # => 'rainbow' entry = client.entry 'nyancat' # => # ) dynamic_entries: :auto, space: 'cfexampleapi', access_token: 'b4c0n73n7fu1', client = Contentful::Client.new(However, you can (and should) set `:dynamic_entries` to `:auto` in your client configuration. When using this option, the client will fetch all available content types and use them to create dynamic entries on the fly.### Dynamic EntriesPlease note, that no field type conversions will be done for entries by default. entry.fields[:color] # rainbow entry = client.entry 'nyancat'Entry Fields usually don't have direct method accessors, since they are based on individual content types. These fields can be accessed through the `#fields` method: asset.sys # { id: '...', type: '...' } entry.type # => 'Entry' content_type.id # => 'cat'System Properties behave the same and can be accessed via the `#sys` method. content_type.properties # { name: '...', description: '...' }Alternatively, the data can be accessed as Ruby Hash: content_type.description # "Meow." content_type = client.content_type 'cat'The results are returned as Contentful::Resource objects. Multiple results will be returned as Contentful::Array. The properties of a resource can be accessed through Ruby methods. client.entries(include: 1) # include one level of linked resources client.entries('sys.id[ne]' => 'nyancat') # query for all entries except 'nyancat'You can pass the usual filter options to the query: client.entry 'nyancat' client.content_types[Delivery API Documentation](https://www.contentful.com/developers/documentation/content-delivery-api/). Please note, that all methods of the Ruby client library are snake_cased, instead of JavaScript's camelCase:You can query for entries, assets, etc. very similar as described in the ) space: 'cfexampleapi' access_token: 'b4c0n73n7fu1', client = Contentful::Client.new(## Usage gem 'contentful'Add to your Gemfile and bundle:## Setup[Contentful](https://www.contentful.com) is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit & manage content in the cloud and publish it anywhere via powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.Ruby client for the [Contentful](https://www.contentful.com) Content Delivery API.# contentful.rbad_H k} | _ ' & %   ~ r q G F ( ' F E 0 / Z Y C B    O N "  gJ& MLK76Z=RQCopyright (c) 2014 Contentful GmbH - Jan Lelis. See LICENSE.txt for further details.## LicenseMore information on dynamic entries are available in examples/dynamic_entries.rb client.register_dynamic_entry 'cat', MyCat MyCat = Contentful::DynamicEntry.create(content_type) content_type = client.content_type 'cat' ) dynamice_entries: :manual, # default access_token: 'b4c0n73n7fu1', space: 'cfexampleapi', client = Contentful::Client.new(In `dynamic_entries: :auto` mode, all entries are returned as specialized entry classes. However, you can also create these specialized classes by yourself, based on a content type:### Dynamic EntriesMore information on `:resource_mapping` can be found in examples/resource_mapping.rb and more on custom classes in examples/custom_classes.rb ) } 'Asset' => MyBetterAsset, resource_mapping: { access_token: 'b4c0n73n7fu1', space: 'cfexampleapi', client = Contentful::Client.new(You can register your custom class on client initialization: end end image_url.sub %r<\A//>, 'https://' def https_image_url class MyBetterAsset < Contentful::AssetYou can define your own classes that will be returned instead of the predefined ones. Consider, you want to build a better Asset class. One way to do this is:### Custom Resource Classes## Advanced UsageSee next paragraph for explanation### :resource_mappingDefaults to `false`. If enabled, the API responses will not be parsed to resource objects. Might be useful for debugging.### :raw_mode`:auto` or `:manual`. See resource description above for details on usage.### :dynamic_entriesIf set to `true` (default), error responses will be raised. If set to `false`, the error objects will simply be returned.### :raise_errorsHow to authenticate with the API. Supports `:header` (default) or `:query_string`.### :authentication_mechanismWhether to use https. Defaults to `true`.### :secureRequired option. The space's secret token.### :access_tokenRequired option. The name of the space you want to access.### :space## Client Configuration Options entries.reload # Fetches the array of entries again entries = client.entriesResources, that have been requested directly (i.e. no child resources), can be fetched from the server again by calling `#reload`:### Resource Options # 382a48dfa2cb16c47aa2c72f7b23bf09/happycatw.jpg?w=300&h=200&fm=jpg&q=100" # => "//images.contentful.com/cfexampleapi/3MZPnjZTIskAIIkuuosCss/ client.find('happycat').image_url width: 300, height: 200, format: 'jpg', quality: 100 # 382a48dfa2cb16c47aa2c72f7b23bf09/happycatw.jpg" # => "//images.contentful.com/cfexampleapi/3MZPnjZTIskAIIkuuosCss/ client.find('happycat').image_urlThere is a helpful method to add image resize options for an asset image: