Class: Jeog::File

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ File

Returns a new instance of File.



7
8
9
10
# File 'lib/jeog/file.rb', line 7

def initialize(file_name)
  @file_name = file_name
  @directory, @file = ::File.split file_name
end

Instance Attribute Details

#directoryObject

Returns the value of attribute directory.



5
6
7
# File 'lib/jeog/file.rb', line 5

def directory
  @directory
end

#fileObject

Returns the value of attribute file.



5
6
7
# File 'lib/jeog/file.rb', line 5

def file
  @file
end

#file_nameObject

Returns the value of attribute file_name.



5
6
7
# File 'lib/jeog/file.rb', line 5

def file_name
  @file_name
end

Instance Method Details

#alternative_json_fileObject



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

def alternative_json_file
  "#{@file.gsub(/\.jeog/, '')}.json"
end

#json_dataObject



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

def json_data
  ::IO.read(@file_name, nil, 4)
end

#raw_dataObject



16
17
18
# File 'lib/jeog/file.rb', line 16

def raw_data
  ::IO.read @file_name
end

#statObject



12
13
14
# File 'lib/jeog/file.rb', line 12

def stat
  ::File.stat @file_name
end