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.
3796 3797 3798 3799 3800 |
# File 'lib/basecamp/generated/types.rb', line 3796 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.
3789 3790 3791 |
# File 'lib/basecamp/generated/types.rb', line 3789 def all_day @all_day end |
#ends_at ⇒ Object
Returns the value of attribute ends_at.
3789 3790 3791 |
# File 'lib/basecamp/generated/types.rb', line 3789 def ends_at @ends_at end |
#starts_at ⇒ Object
Returns the value of attribute starts_at.
3789 3790 3791 |
# File 'lib/basecamp/generated/types.rb', line 3789 def starts_at @starts_at end |
Class Method Details
.required_fields ⇒ Array<Symbol>
3792 3793 3794 |
# File 'lib/basecamp/generated/types.rb', line 3792 def self.required_fields %i[all_day ends_at starts_at].freeze end |
Instance Method Details
#to_h ⇒ Object
3802 3803 3804 3805 3806 3807 3808 |
# File 'lib/basecamp/generated/types.rb', line 3802 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
3810 3811 3812 |
# File 'lib/basecamp/generated/types.rb', line 3810 def to_json(*args) to_h.to_json(*args) end |