Class: Egnyte::Item

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

Direct Known Subclasses

File, Folder

Instance Method Summary collapse

Constructor Details

#initialize(data, session) ⇒ Item

Returns a new instance of Item.



3
4
5
6
# File 'lib/egnyte/item.rb', line 3

def initialize(data, session)
  @data = data
  @session = session
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



8
9
10
# File 'lib/egnyte/item.rb', line 8

def method_missing(method, *args, &block)
  @data[method.to_s]
end

Instance Method Details

#fs_path(mode = 'fs') ⇒ Object

mode can be either fs, or fs-content.



18
19
20
# File 'lib/egnyte/item.rb', line 18

def fs_path(mode='fs')
  "https://#{@session.domain}.egnyte.com/#{@session.api}/v1/#{mode}/"
end

#update_data(data) ⇒ Object



12
13
14
15
# File 'lib/egnyte/item.rb', line 12

def update_data(data)
  @data = @data.update(data)
  self
end