Class: LayerVault::File

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

Class Method Summary collapse

Methods inherited from Model

build_associations, #set_context

Class Method Details

.for(organization, project, folder_path, file_name) ⇒ Object



4
5
6
7
8
# File 'lib/layervault/file.rb', line 4

def for(organization, project, folder_path, file_name)
  resp = MultiJson.decode(LayerVault.client.file(organization, project, folder_path, file_name))
  instance = build_associations(resp, :revisions)
  instance.set_context(organization: organization, project: project, folder_path: folder_path, file_name: file_name)
end