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, #initialize, #to_a, #type

Constructor Details

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

Instance Method Details

#applyObject



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

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

#checktrue, false

Returns:

  • (true, false)


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

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