Class: Basecamp::Types::MessageType
- Inherits:
-
Object
- Object
- Basecamp::Types::MessageType
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
MessageType
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ MessageType
constructor
A new instance of MessageType.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ MessageType
Returns a new instance of MessageType.
2154 2155 2156 2157 2158 2159 2160 |
# File 'lib/basecamp/generated/types.rb', line 2154 def initialize(data = {}) @created_at = parse_datetime(data["created_at"]) @icon = data["icon"] @id = parse_integer(data["id"]) @name = data["name"] @updated_at = parse_datetime(data["updated_at"]) end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
2147 2148 2149 |
# File 'lib/basecamp/generated/types.rb', line 2147 def created_at @created_at end |
#icon ⇒ Object
Returns the value of attribute icon.
2147 2148 2149 |
# File 'lib/basecamp/generated/types.rb', line 2147 def icon @icon end |
#id ⇒ Object
Returns the value of attribute id.
2147 2148 2149 |
# File 'lib/basecamp/generated/types.rb', line 2147 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
2147 2148 2149 |
# File 'lib/basecamp/generated/types.rb', line 2147 def name @name end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
2147 2148 2149 |
# File 'lib/basecamp/generated/types.rb', line 2147 def updated_at @updated_at end |
Class Method Details
.required_fields ⇒ Array<Symbol>
2150 2151 2152 |
# File 'lib/basecamp/generated/types.rb', line 2150 def self.required_fields %i[created_at icon id name updated_at].freeze end |
Instance Method Details
#to_h ⇒ Object
2162 2163 2164 2165 2166 2167 2168 2169 2170 |
# File 'lib/basecamp/generated/types.rb', line 2162 def to_h { "created_at" => @created_at, "icon" => @icon, "id" => @id, "name" => @name, "updated_at" => @updated_at, }.compact end |
#to_json(*args) ⇒ Object
2172 2173 2174 |
# File 'lib/basecamp/generated/types.rb', line 2172 def to_json(*args) to_h.to_json(*args) end |