Class: Basecamp::Types::TimelineEventData
- Inherits:
-
Object
- Object
- Basecamp::Types::TimelineEventData
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
TimelineEventData
Instance Attribute Summary collapse
-
#all_day ⇒ Object
Returns the value of attribute all_day.
-
#ends_at ⇒ Object
Returns the value of attribute ends_at.
-
#starts_at ⇒ Object
Returns the value of attribute starts_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ TimelineEventData
constructor
A new instance of TimelineEventData.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ TimelineEventData
Returns a new instance of TimelineEventData.
4108 4109 4110 4111 4112 |
# File 'lib/basecamp/generated/types.rb', line 4108 def initialize(data = {}) @all_day = parse_boolean(data["all_day"]) @ends_at = data["ends_at"] @starts_at = data["starts_at"] end |
Instance Attribute Details
#all_day ⇒ Object
Returns the value of attribute all_day.
4101 4102 4103 |
# File 'lib/basecamp/generated/types.rb', line 4101 def all_day @all_day end |
#ends_at ⇒ Object
Returns the value of attribute ends_at.
4101 4102 4103 |
# File 'lib/basecamp/generated/types.rb', line 4101 def ends_at @ends_at end |
#starts_at ⇒ Object
Returns the value of attribute starts_at.
4101 4102 4103 |
# File 'lib/basecamp/generated/types.rb', line 4101 def starts_at @starts_at end |
Class Method Details
.required_fields ⇒ Array<Symbol>
4104 4105 4106 |
# File 'lib/basecamp/generated/types.rb', line 4104 def self.required_fields %i[all_day ends_at starts_at].freeze end |
Instance Method Details
#to_h ⇒ Object
4114 4115 4116 4117 4118 4119 4120 |
# File 'lib/basecamp/generated/types.rb', line 4114 def to_h { "all_day" => @all_day, "ends_at" => @ends_at, "starts_at" => @starts_at, }.reject { |k, v| v.nil? && !["ends_at", "starts_at"].include?(k) } end |
#to_json(*args) ⇒ Object
4122 4123 4124 |
# File 'lib/basecamp/generated/types.rb', line 4122 def to_json(*args) to_h.to_json(*args) end |