Class: Raykit::SourceImports

Inherits:
Array
  • Object
show all
Defined in:
lib/raykit/sourceImports.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(urls) ⇒ SourceImports

Returns a new instance of SourceImports.



5
6
7
8
9
# File 'lib/raykit/sourceImports.rb', line 5

def initialize(urls)
    urls.each{|url|
        self << SourceImport.new(url)
    }
end

Class Method Details

.load(filename) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/raykit/sourceImports.rb', line 29

def self.load(filename)
    sourceImports = SourceImports.new([])
    array=JSON.parse(IO.read(filename))
    array.each{|hash|
        sourceImports << SourceImport.new(hash['remote'])
    }
    sourceImports
end

Instance Method Details

#copyObject



17
18
19
20
21
# File 'lib/raykit/sourceImports.rb', line 17

def copy
    self.each{|si|
        si.copy
    }
end

#save(filename) ⇒ Object



23
24
25
26
27
# File 'lib/raykit/sourceImports.rb', line 23

def save(filename)
    File.open(filename,'w'){|f|
        f.write(self.to_json)
    }
end

#updateObject



11
12
13
14
15
# File 'lib/raykit/sourceImports.rb', line 11

def update
    self.each{|si|
        si.update
    }
end