Class: Egnyte::Item
- Inherits:
-
Object
- Object
- Egnyte::Item
- Defined in:
- lib/egnyte/item.rb
Instance Method Summary collapse
-
#fs_path(mode = 'fs') ⇒ Object
mode can be either fs, or fs-content.
-
#initialize(data, session) ⇒ Item
constructor
A new instance of Item.
- #method_missing(method, *args, &block) ⇒ Object
- #update_data(data) ⇒ Object
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 |