Class: Contentful::Exporter::Drupal::User

Inherits:
Object
  • Object
show all
Defined in:
lib/drupal/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exporter, config) ⇒ User

Returns a new instance of User.



8
9
10
# File 'lib/drupal/user.rb', line 8

def initialize(exporter, config)
  @exporter, @config = exporter, config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/drupal/user.rb', line 6

def config
  @config
end

#exporterObject (readonly)

Returns the value of attribute exporter.



6
7
8
# File 'lib/drupal/user.rb', line 6

def exporter
  @exporter
end

Instance Method Details

#save_users_as_jsonObject



12
13
14
15
16
17
# File 'lib/drupal/user.rb', line 12

def save_users_as_json
  exporter.create_directory("#{config.entries_dir}/user")
  config.db[:users].each do |user_row|
    extract_data(user_row)
  end
end