Skip to content

Commit

Permalink
Use attr_reader and adding comment for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Subash Pradhan committed Oct 24, 2024
1 parent cebc7ad commit 1a9de6c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/nylas/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require_relative "resources/webhooks"
require_relative "resources/applications"
require_relative "resources/folders"
require_relative "resources/scheduling"
require_relative "resources/scheduler"
require_relative "resources/configurations"
require_relative "resources/sessions"
require_relative "resources/availability"
Expand Down
38 changes: 13 additions & 25 deletions lib/nylas/resources/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,26 @@
require_relative "./availability"

module Nylas
# Nylas Scheduler API
# This class provides access to the Scheduler resources, including
# configurations, bookings, sessions, and availability.
#
# @attr_reader [Nylas::Configurations] configurations The Scheduler configurations resource for your Nylas application.
# @attr_reader [Nylas::Bookings] bookings The Scheduler bookings resource for your Nylas application.
# @attr_reader [Nylas::Sessions] sessions The Scheduler sessions resource for your Nylas application.
# @attr_reader [Nylas::Availability] availability The Scheduler availability resource for your Nylas application.
class Scheduler
attr_reader :configurations, :sessions, :bookings, :availability

# Initializes the Scheduler class.
#
# @param api_client [APIClient] The Nylas API client instance for making requests.
def initialize(api_client)
@api_client = api_client
@configurations = Configurations.new(@api_client)
@bookings = Bookings.new(@api_client)
@sessions = Sessions.new(@api_client)
@availability = Availability.new(@api_client)
end

# The configuration resources for your Nylas application.
# @return [Nylas::Scheduler::Confiugrations] Scheduler configuration resources
# for your Nylas application.
def configurations
@configurations
end

# The Session resources for your Nylas application.
# @return [Nylas::Scheduler::Sessions] Scheduler session resources for your Nylas application.
def sessions
@sessions
end

# The Booking resources for your Nylas application.
# @return [Nylas::Scheduler::Bookings] Scheduler booking resources for your Nylas application.
def bookings
@bookings
end

# The availability resources for your Nylas application.
# @return [Nylas::Scheduler::Availability] Scheduling availability resources for your Nylas application.
def availability
@availability
end
end
end

0 comments on commit 1a9de6c

Please sign in to comment.