Class: Calendly::RoutingForm
- Inherits:
-
Object
- Object
- Calendly::RoutingForm
- Includes:
- ModelUtils
- Defined in:
- lib/calendly/models/routing_form.rb
Overview
Calendly’s routing form model.
Constant Summary collapse
- UUID_RE =
%r{\A#{Client::API_HOST}/routing_forms/(#{UUID_FORMAT})\z}.freeze
- TIME_FIELDS =
%i[created_at updated_at].freeze
Constants included from ModelUtils
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Moment when user record was first created.
-
#name ⇒ String
The routing form name (in human-readable format).
-
#organization ⇒ Calendly::Organization
The URI of the organization that’s associated with the routing form.
-
#questions ⇒ Array<Calendly::RoutingFormQuestion>
An ordered collection of Routing Form non-deleted questions.
-
#status ⇒ String
Indicates if the form is in “draft” or “published” status.
-
#updated_at ⇒ Time
Moment when user record was last updated.
-
#uri ⇒ String
Canonical reference (unique identifier) for the routing form.
-
#uuid ⇒ String
unique id of the RoutingForm object.
Class Method Summary collapse
Instance Method Summary collapse
-
#fetch ⇒ Calendly::RoutingForm
Get Routing Form associated with self.
-
#submissions(options: nil) ⇒ Array<Calendly::RoutingFormSubmission>
Returns all Routing Form Submissions associated with self.
- #submissions!(options: nil) ⇒ Object
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#created_at ⇒ Time
Moment when user record was first created.
35 36 37 |
# File 'lib/calendly/models/routing_form.rb', line 35 def created_at @created_at end |
#name ⇒ String
The routing form name (in human-readable format).
27 28 29 |
# File 'lib/calendly/models/routing_form.rb', line 27 def name @name end |
#organization ⇒ Calendly::Organization
The URI of the organization that’s associated with the routing form.
43 44 45 |
# File 'lib/calendly/models/routing_form.rb', line 43 def organization @organization end |
#questions ⇒ Array<Calendly::RoutingFormQuestion>
An ordered collection of Routing Form non-deleted questions.
47 48 49 |
# File 'lib/calendly/models/routing_form.rb', line 47 def questions @questions end |
#status ⇒ String
Indicates if the form is in “draft” or “published” status.
31 32 33 |
# File 'lib/calendly/models/routing_form.rb', line 31 def status @status end |
#updated_at ⇒ Time
Moment when user record was last updated.
39 40 41 |
# File 'lib/calendly/models/routing_form.rb', line 39 def updated_at @updated_at end |
#uri ⇒ String
Canonical reference (unique identifier) for the routing form.
23 24 25 |
# File 'lib/calendly/models/routing_form.rb', line 23 def uri @uri end |
#uuid ⇒ String
unique id of the RoutingForm object.
19 20 21 |
# File 'lib/calendly/models/routing_form.rb', line 19 def uuid @uuid end |
Class Method Details
.association ⇒ Object
10 11 12 13 14 15 |
# File 'lib/calendly/models/routing_form.rb', line 10 def self.association { organization: Organization, questions: RoutingFormQuestion } end |
Instance Method Details
#fetch ⇒ Calendly::RoutingForm
Get Routing Form associated with self.
56 57 58 |
# File 'lib/calendly/models/routing_form.rb', line 56 def fetch client.routing_form uuid end |
#submissions(options: nil) ⇒ Array<Calendly::RoutingFormSubmission>
Returns all Routing Form Submissions associated with self.
71 72 73 74 75 76 |
# File 'lib/calendly/models/routing_form.rb', line 71 def submissions(options: nil) return @cached_submissions if defined?(@cached_submissions) && @cached_submissions request_proc = proc { |opts| client.routing_form_submissions uri, options: opts } @cached_submissions = auto_pagination request_proc, end |
#submissions!(options: nil) ⇒ Object
79 80 81 82 |
# File 'lib/calendly/models/routing_form.rb', line 79 def submissions!(options: nil) @cached_submissions = nil submissions options: end |