Class: Ploy::YamlReader

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

Instance Method Summary collapse

Instance Method Details

#from_file(path) ⇒ Object



5
6
7
# File 'lib/ploy/yamlreader.rb', line 5

def from_file(path)
  YAML.load(File.read(path))
end

#from_http(url) ⇒ Object



13
14
15
16
# File 'lib/ploy/yamlreader.rb', line 13

def from_http(url)
  txt = Net::HTTP.get(URI(url))
  YAML.load(txt)
end

#from_s3(bucket, name) ⇒ Object



9
10
11
# File 'lib/ploy/yamlreader.rb', line 9

def from_s3(bucket, name)
  YAML.load(Ploy::S3Storage.new(bucket).read(name))
end