Class: Serverkit::Resources::File

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

Instance Attribute Summary

Attributes inherited from Base

#backend

Instance Method Summary collapse

Methods inherited from Base

#initialize, #name

Constructor Details

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

Instance Method Details

#apply ⇒ Object



7
8
9
10
11
# File 'lib/serverkit/resources/file.rb', line 7

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

#check ⇒ true, false

Returns:

  • (true, false)


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

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