Class: Machinery::SystemFile

Inherits:
Object
  • Object
show all
Defined in:
lib/system_file.rb

Instance Attribute Summary

Attributes inherited from Object

#attributes, #scope

Instance Method Summary collapse

Methods inherited from Object

#==, #[], #[]=, #as_json, #compare_with, convert_element, convert_raw_hash, #empty?, from_json, has_property, #hash, #initialize, #initialize_copy, #method_missing, #respond_to?, #set_attributes

Constructor Details

This class inherits a constructor from Machinery::Object

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Machinery::Object

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


36
37
38
39
40
41
42
# File 'lib/system_file.rb', line 36

def deleted?
  if changes && changes.include?("deleted")
    true
  else
    false
  end
end

#directory?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/system_file.rb', line 28

def directory?
  type == "dir"
end

#file?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/system_file.rb', line 20

def file?
  type == "file"
end

#link?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/system_file.rb', line 24

def link?
  type == "link"
end

#remote_directory?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/system_file.rb', line 32

def remote_directory?
  type == "remote_dir"
end