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.
4341 4342 4343 4344 4345 |
# File 'lib/basecamp/generated/types.rb', line 4341 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.
4334 4335 4336 |
# File 'lib/basecamp/generated/types.rb', line 4334 def all_day @all_day end |
#ends_at ⇒ Object
Returns the value of attribute ends_at.
4334 4335 4336 |
# File 'lib/basecamp/generated/types.rb', line 4334 def ends_at @ends_at end |
#starts_at ⇒ Object
Returns the value of attribute starts_at.
4334 4335 4336 |
# File 'lib/basecamp/generated/types.rb', line 4334 def starts_at @starts_at end |
Class Method Details
.required_fields ⇒ Array<Symbol>
4337 4338 4339 |
# File 'lib/basecamp/generated/types.rb', line 4337 def self.required_fields %i[all_day ends_at starts_at].freeze end |
Instance Method Details
#to_h ⇒ Object
4347 4348 4349 4350 4351 4352 4353 |
# File 'lib/basecamp/generated/types.rb', line 4347 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
4355 4356 4357 |
# File 'lib/basecamp/generated/types.rb', line 4355 def to_json(*args) to_h.to_json(*args) end |