Class: Basecamp::Types::MessageType

Inherits:
Object
  • Object
show all
Includes:
TypeHelpers
Defined in:
lib/basecamp/generated/types.rb

Overview

MessageType

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ MessageType

Returns a new instance of MessageType.



1957
1958
1959
1960
1961
1962
1963
# File 'lib/basecamp/generated/types.rb', line 1957

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_atObject

Returns the value of attribute created_at.



1950
1951
1952
# File 'lib/basecamp/generated/types.rb', line 1950

def created_at
  @created_at
end

#iconObject

Returns the value of attribute icon.



1950
1951
1952
# File 'lib/basecamp/generated/types.rb', line 1950

def icon
  @icon
end

#idObject

Returns the value of attribute id.



1950
1951
1952
# File 'lib/basecamp/generated/types.rb', line 1950

def id
  @id
end

#nameObject

Returns the value of attribute name.



1950
1951
1952
# File 'lib/basecamp/generated/types.rb', line 1950

def name
  @name
end

#updated_atObject

Returns the value of attribute updated_at.



1950
1951
1952
# File 'lib/basecamp/generated/types.rb', line 1950

def updated_at
  @updated_at
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1953
1954
1955
# File 'lib/basecamp/generated/types.rb', line 1953

def self.required_fields
  %i[created_at icon id name updated_at].freeze
end

Instance Method Details

#to_hObject



1965
1966
1967
1968
1969
1970
1971
1972
1973
# File 'lib/basecamp/generated/types.rb', line 1965

def to_h
  {
    "created_at" => @created_at,
    "icon" => @icon,
    "id" => @id,
    "name" => @name,
    "updated_at" => @updated_at,
  }.compact
end

#to_json(*args) ⇒ Object



1975
1976
1977
# File 'lib/basecamp/generated/types.rb', line 1975

def to_json(*args)
  to_h.to_json(*args)
end