Class: Locomotive::Mounter::Writer::Api::SiteWriter
- Defined in:
- lib/locomotive/mounter/writer/api/site_writer.rb
Instance Attribute Summary collapse
-
#remote_site ⇒ Object
Returns the value of attribute remote_site.
Attributes inherited from Base
Instance Method Summary collapse
-
#prepare ⇒ Object
Check if the site has to be created before.
-
#write ⇒ Object
Create the site if it does not exist.
Methods inherited from Base
#absolute_path, #data?, #each_locale, #get, #initialize, #path_to_file, #post, #put, #replace_content_assets!
Constructor Details
This class inherits a constructor from Locomotive::Mounter::Writer::Api::Base
Instance Attribute Details
#remote_site ⇒ Object
Returns the value of attribute remote_site.
8 9 10 |
# File 'lib/locomotive/mounter/writer/api/site_writer.rb', line 8 def remote_site @remote_site end |
Instance Method Details
#prepare ⇒ Object
Check if the site has to be created before.
11 12 13 14 15 |
# File 'lib/locomotive/mounter/writer/api/site_writer.rb', line 11 def prepare super self.fetch_site end |
#write ⇒ Object
Create the site if it does not exist
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/locomotive/mounter/writer/api/site_writer.rb', line 18 def write if self.site.persisted? self.check_locales! unless self.force? # requirements if self.force? self.update_site end else self.create_site end end |