Class: Wlparams::TxtToParam

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#param1Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param1
  @param1
end

#param10Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param10
  @param10
end

#param11Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param11
  @param11
end

#param12Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param12
  @param12
end

#param13Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param13
  @param13
end

#param14Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param14
  @param14
end

#param15Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param15
  @param15
end

#param16Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param16
  @param16
end

#param17Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param17
  @param17
end

#param18Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param18
  @param18
end

#param19Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param19
  @param19
end

#param2Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param2
  @param2
end

#param20Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param20
  @param20
end

#param21Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param21
  @param21
end

#param22Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param22
  @param22
end

#param23Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param23
  @param23
end

#param24Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param24
  @param24
end

#param25Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param25
  @param25
end

#param26Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param26
  @param26
end

#param27Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param27
  @param27
end

#param28Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param28
  @param28
end

#param29Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param29
  @param29
end

#param3Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param3
  @param3
end

#param30Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param30
  @param30
end

#param31Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param31
  @param31
end

#param32Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param32
  @param32
end

#param33Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param33
  @param33
end

#param34Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param34
  @param34
end

#param35Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param35
  @param35
end

#param36Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param36
  @param36
end

#param37Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param37
  @param37
end

#param38Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param38
  @param38
end

#param39Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param39
  @param39
end

#param4Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param4
  @param4
end

#param40Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param40
  @param40
end

#param41Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param41
  @param41
end

#param42Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param42
  @param42
end

#param43Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param43
  @param43
end

#param44Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param44
  @param44
end

#param45Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param45
  @param45
end

#param5Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param5
  @param5
end

#param6Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param6
  @param6
end

#param7Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param7
  @param7
end

#param8Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param8
  @param8
end

#param9Object

parameters from weatherlink ‘dounloads.txt’ file



6
7
8
# File 'lib/wlparams.rb', line 6

def param9
  @param9
end

Class Method Details

.create_fileObject



18
19
20
21
# File 'lib/wlparams.rb', line 18

def self.create_file 
# Create new file
require 'fileutils'
end

.file_exists?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/wlparams.rb', line 14

def self.file_exists?
# Vofy if the file exists
end

.saved_rowsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/wlparams.rb', line 23

def self.saved_rows
   @params = []
   # file path, NOTE: The default file it´s in the application root path  
      file = File.new('download.txt', 'r')
      file.each_line do |line|
                if line =~ /^[0-9]/ 
     @params << TxtToParam.new.import_line(line.chomp)
      end
   end
               
      file.close
# Read report files
# Return instance
   return @params

end

Instance Method Details

#import_line(line) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/wlparams.rb', line 40

def import_line(line)  

 #Conveting an array to individual variables for each parameter.
line_array = line.split("\t")
@param1, @param2, @param3, @param4, @param5, @param6, @param7, @param8, @param9, @param10, 
@param11, @param12, @param13, @param14, @param15, @param16, @param17, @param18, @param19, @param20, @param21, @param22, @param23,
@param24, @param25, @param26, @param27, @param28, @param29, @param30, @param31, @param32, @param33, 
@param34, @param35, @param36, @param37, @param38, @param39, @param40, @param41, @param42, @param43,
@param44, param45  = line_array
return self
end