Class: Puppet::FileServing::Metadata::MetaStat Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/puppet/file_serving/metadata.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

WindowsStat

Instance Method Summary collapse

Constructor Details

#initialize(stat, source_permissions) ⇒ MetaStat

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MetaStat.



48
49
50
51
# File 'lib/puppet/file_serving/metadata.rb', line 48

def initialize(stat, source_permissions)
  @stat = stat
  @source_permissions_ignore = (!source_permissions || source_permissions == :ignore)
end

Instance Method Details

#groupObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



57
58
59
# File 'lib/puppet/file_serving/metadata.rb', line 57

def group
  @source_permissions_ignore ? Process.egid : @stat.gid
end

#modeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



61
62
63
# File 'lib/puppet/file_serving/metadata.rb', line 61

def mode
  @source_permissions_ignore ? 0644 : @stat.mode
end

#ownerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



53
54
55
# File 'lib/puppet/file_serving/metadata.rb', line 53

def owner
  @source_permissions_ignore ? Process.euid : @stat.uid
end