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.
3829 3830 3831 3832 3833 |
# File 'lib/basecamp/generated/types.rb', line 3829 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.
3822 3823 3824 |
# File 'lib/basecamp/generated/types.rb', line 3822 def all_day @all_day end |
#ends_at ⇒ Object
Returns the value of attribute ends_at.
3822 3823 3824 |
# File 'lib/basecamp/generated/types.rb', line 3822 def ends_at @ends_at end |
#starts_at ⇒ Object
Returns the value of attribute starts_at.
3822 3823 3824 |
# File 'lib/basecamp/generated/types.rb', line 3822 def starts_at @starts_at end |
Class Method Details
.required_fields ⇒ Array<Symbol>
3825 3826 3827 |
# File 'lib/basecamp/generated/types.rb', line 3825 def self.required_fields %i[all_day ends_at starts_at].freeze end |
Instance Method Details
#to_h ⇒ Object
3835 3836 3837 3838 3839 3840 3841 |
# File 'lib/basecamp/generated/types.rb', line 3835 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
3843 3844 3845 |
# File 'lib/basecamp/generated/types.rb', line 3843 def to_json(*args) to_h.to_json(*args) end |