Sha256: 735a5e060ebda381718212e335811fc92f4c92472c7d196a3b8942a7033fa842

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

module Salesforce
  module Rails
    module API
      class CalendarEvent
          include Salesforce::Rails::API::Client
          
          class << self
            # Returns all calendar events.
            #
            #   Salesforce::Rails::API::CalendarEvent.all #=> [#<Event @Id="1", ...>, #<Event @Id="2", ...>, #<Event @Id="3", ...>, ...]
            def all
              client.query("SELECT Id, Subject, IsAllDayEvent, StartDateTime, EndDateTime, Description, Owner.Name, ShowAs FROM Event")
            end

            # Returns a collection of events of self that match the conditional +where_expr+, which is the WHERE part of a SOQL query.
            #
            #   Salesforce::Rails::API::CalendarEvent.query("Name = 'test'") #=> [#<Event @Id="1", @Name="test", ...>, #<Event @Id="2", @Name="test", ...>, #<Event @Id="3", @Name="test", ...>, ...]
            def query(where_expr)
              client.query("SELECT Id, Subject, IsAllDayEvent, StartDateTime, EndDateTime, Description, Owner.Name, ShowAs FROM Event WHERE #{where_expr}")
            end
          end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
salesforce-rails-1.0.1 lib/salesforce/rails/api/calendar_event.rb