Class: Serverkit::Resources::File

Inherits:
Base
  • Object
show all
Defined in:
lib/serverkit/resources/file.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #backend, #recipe

Instance Method Summary collapse

Methods inherited from Base

#all_errors, attribute, #handlers, #id, #initialize, #inspect_apply_result, #inspect_check_result, #notifiable?, #run_apply, #run_check, #successful?, #to_a

Constructor Details

This class inherits a constructor from Serverkit::Resources::Base

Instance Method Details

#applyObject

Note:

Override



13
14
15
16
17
# File 'lib/serverkit/resources/file.rb', line 13

def apply
  send_file if file_sendable?
  change_group unless has_valid_group?
  change_owner unless has_valid_owner?
end

#checkObject

Note:

Override



20
21
22
# File 'lib/serverkit/resources/file.rb', line 20

def check
  has_file? && has_same_content? && has_valid_group? && has_valid_owner?
end