Class: Contentful::Exporter::Drupal::ContentType
- Inherits:
-
Object
- Object
- Contentful::Exporter::Drupal::ContentType
- Defined in:
- lib/drupal/content_type.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#exporter ⇒ Object
readonly
Returns the value of attribute exporter.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(exporter, config, type, schema) ⇒ ContentType
constructor
A new instance of ContentType.
- #save_content_types_as_json ⇒ Object
Constructor Details
#initialize(exporter, config, type, schema) ⇒ ContentType
8 9 10 11 12 13 |
# File 'lib/drupal/content_type.rb', line 8 def initialize(exporter, config, type, schema) @exporter = exporter @config = config @type = type @schema = schema end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/drupal/content_type.rb', line 6 def config @config end |
#exporter ⇒ Object (readonly)
Returns the value of attribute exporter.
6 7 8 |
# File 'lib/drupal/content_type.rb', line 6 def exporter @exporter end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
6 7 8 |
# File 'lib/drupal/content_type.rb', line 6 def schema @schema end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/drupal/content_type.rb', line 6 def type @type end |
Instance Method Details
#save_content_types_as_json ⇒ Object
15 16 17 18 19 20 |
# File 'lib/drupal/content_type.rb', line 15 def save_content_types_as_json exporter.create_directory("#{config.entries_dir}/#{type}") config.db[:node].where(type: type).each do |content_row| extract_data(content_row) end end |