Class: Contentful::Exporter::Wordpress::PostAttachment
- Defined in:
- lib/wordpress/post_attachment.rb
Instance Attribute Summary collapse
-
#post ⇒ Object
readonly
Returns the value of attribute post.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Attributes inherited from Post
Attributes inherited from Blog
Instance Method Summary collapse
- #attachment_extractor ⇒ Object
-
#initialize(post, settings) ⇒ PostAttachment
constructor
A new instance of PostAttachment.
Methods inherited from Post
Methods inherited from Blog
#blog_extractor, #create_directory, #link_asset, #link_entry, #output_logger, #write_json_to_file
Constructor Details
#initialize(post, settings) ⇒ PostAttachment
Returns a new instance of PostAttachment.
9 10 11 12 |
# File 'lib/wordpress/post_attachment.rb', line 9 def initialize(post, settings) @post = post @settings = settings end |
Instance Attribute Details
#post ⇒ Object (readonly)
Returns the value of attribute post.
7 8 9 |
# File 'lib/wordpress/post_attachment.rb', line 7 def post @post end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
7 8 9 |
# File 'lib/wordpress/post_attachment.rb', line 7 def settings @settings end |
Instance Method Details
#attachment_extractor ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/wordpress/post_attachment.rb', line 14 def create_directory("#{settings.assets_dir}/attachment_post") asset = { id: , description: , url: } unless asset[:url].nil? write_json_to_file("#{settings.assets_dir}/attachment_post/#{}.json", asset) asset end end |