Class: FileObject

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, Workflows
Defined in:
lib/sambal-cle/data_objects/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Workflows

menu_link, #open_my_site_by_name, #reset

Constructor Details

#initialize(browser, opts = {}) ⇒ FileObject

Returns a new instance of FileObject.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/sambal-cle/data_objects/resource.rb', line 9

def initialize(browser, opts={})
  @browser = browser

  defaults = {
  }
  options = defaults.merge(opts)

  set_options(options)
  @target_folder=@site if options[:target_folder]==nil
  requires @site
end

Instance Attribute Details

#hrefObject

Returns the value of attribute href.



7
8
9
# File 'lib/sambal-cle/data_objects/resource.rb', line 7

def href
  @href
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/sambal-cle/data_objects/resource.rb', line 7

def name
  @name
end

#siteObject

Returns the value of attribute site.



7
8
9
# File 'lib/sambal-cle/data_objects/resource.rb', line 7

def site
  @site
end

#source_pathObject

Returns the value of attribute source_path.



7
8
9
# File 'lib/sambal-cle/data_objects/resource.rb', line 7

def source_path
  @source_path
end

#target_folderObject

Returns the value of attribute target_folder.



7
8
9
# File 'lib/sambal-cle/data_objects/resource.rb', line 7

def target_folder
  @target_folder
end

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/sambal-cle/data_objects/resource.rb', line 21

def create
  open_my_site_by_name @site
  resources
  on Resources do |file|
    file.upload_files_to_folder @target_folder
  end
  on ResourcesUploadFiles do |upload|
    upload.file_to_upload @name, @source_path
    upload.upload_files_now
  end
  on Resources do |file|
    @href = file.href @name
  end
end