Class: Apps::Adapters::Gmail::Markup::Event
- Inherits:
-
BaseContext
- Object
- Base
- BaseContext
- Apps::Adapters::Gmail::Markup::Event
- Defined in:
- lib/apps/adapters/gmail/markup/event.rb
Instance Attribute Summary collapse
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Instance Method Summary collapse
Methods inherited from BaseContext
Methods inherited from Base
Constructor Details
This class inherits a constructor from Apps::Adapters::Gmail::Markup::Base
Instance Attribute Details
#end_date ⇒ Object
Returns the value of attribute end_date.
11 12 13 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 11 def end_date @end_date end |
#location ⇒ Object
Returns the value of attribute location.
11 12 13 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 11 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 11 def name @name end |
#start_date ⇒ Object
Returns the value of attribute start_date.
11 12 13 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 11 def start_date @start_date end |
Instance Method Details
#actions ⇒ Object
23 24 25 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 23 def actions @actions ||= [] end |
#as_json ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 13 def as_json prune super.merge( "name" => name, "startDate" => start_date, "endDate" => end_date, "location" => location&.as_json, "potentialAction" => actions.map(&:as_json) ) end |
#build_location(**attrs) ⇒ Object
27 28 29 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 27 def build_location(**attrs) self.location = Place.new(**attrs) end |
#build_rsvp_actions ⇒ Object
31 32 33 |
# File 'lib/apps/adapters/gmail/markup/event.rb', line 31 def build_rsvp_actions actions.clear.concat(%w[Yes No Maybe].map { |response| RsvpAction.new(response: response) }) end |