Class: Pathname

Inherits:
Object show all
Defined in:
lib/pik/core_ext/pathname.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



21
22
23
24
25
26
# File 'lib/pik/core_ext/pathname.rb', line 21

def ==(other)
  return false unless Pathname === other
  self_ = self.dup.to_ruby.downcase
  other = other.dup.to_ruby.downcase
  self_ == other
end

#rubyObject



13
14
15
# File 'lib/pik/core_ext/pathname.rb', line 13

def ruby
  Pathname(self.to_ruby)
end

#to_rubyObject



9
10
11
# File 'lib/pik/core_ext/pathname.rb', line 9

def to_ruby
  @path.tr('\\','/')
end

#to_sObject Also known as: to_windows



4
5
6
# File 'lib/pik/core_ext/pathname.rb', line 4

def to_s
  @path.tr('/','\\')
end

#windowsObject



17
18
19
# File 'lib/pik/core_ext/pathname.rb', line 17

def windows
  Pathname(self.to_s)
end