Class: RestfulSharePoint::List

Inherits:
Object show all
Defined in:
lib/restful-sharepoint/objects/list.rb

Constant Summary

Constants inherited from Object

Object::DEFAULT_OPTIONS

Instance Attribute Summary

Attributes inherited from Object

#connection, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#fetch_deferred, #initialize, #method_missing, #properties, #properties=, #respond_to_missing?, #to_json, #values

Methods inherited from CommonBase

#objectify

Constructor Details

This class inherits a constructor from RestfulSharePoint::Object

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RestfulSharePoint::Object

Class Method Details

.from_title(title, connection) ⇒ Object



4
5
6
7
8
# File 'lib/restful-sharepoint/objects/list.rb', line 4

def self.from_title(title, connection)
  new(connection: connection).tap do |list|
    list.define_singleton_method(:endpoint) { "/_api/web/lists/getbytitle('#{URI.encode title}')" }
  end
end

Instance Method Details

#endpointObject



10
11
12
# File 'lib/restful-sharepoint/objects/list.rb', line 10

def endpoint
  "/_api/web/lists(guid'#{@id}')"
end