Class: Contentful::Bootstrap::Generator
- Inherits:
-
Object
- Object
- Contentful::Bootstrap::Generator
- Defined in:
- lib/contentful/bootstrap/generator.rb
Instance Method Summary collapse
- #generate_json ⇒ Object
-
#initialize(space_id, access_token) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(space_id, access_token) ⇒ Generator
Returns a new instance of Generator.
9 10 11 |
# File 'lib/contentful/bootstrap/generator.rb', line 9 def initialize(space_id, access_token) @client = Contentful::Client.new(access_token: access_token, space: space_id) end |
Instance Method Details
#generate_json ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/contentful/bootstrap/generator.rb', line 13 def generate_json template = {} template['content_types'] = content_types template['assets'] = assets template['entries'] = entries JSON.pretty_generate(template) end |