Class: Basecamp::Types::DockItem

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

Overview

DockItem

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ DockItem

Returns a new instance of DockItem.



1178
1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/basecamp/generated/types.rb', line 1178

def initialize(data = {})
  @app_url = data["app_url"]
  @enabled = parse_boolean(data["enabled"])
  @id = parse_integer(data["id"])
  @name = data["name"]
  @title = data["title"]
  @url = data["url"]
  @position = parse_integer(data["position"])
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



1171
1172
1173
# File 'lib/basecamp/generated/types.rb', line 1171

def app_url
  @app_url
end

#enabledObject

Returns the value of attribute enabled.



1171
1172
1173
# File 'lib/basecamp/generated/types.rb', line 1171

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



1171
1172
1173
# File 'lib/basecamp/generated/types.rb', line 1171

def id
  @id
end

#nameObject

Returns the value of attribute name.



1171
1172
1173
# File 'lib/basecamp/generated/types.rb', line 1171

def name
  @name
end

#positionObject

Returns the value of attribute position.



1171
1172
1173
# File 'lib/basecamp/generated/types.rb', line 1171

def position
  @position
end

#titleObject

Returns the value of attribute title.



1171
1172
1173
# File 'lib/basecamp/generated/types.rb', line 1171

def title
  @title
end

#urlObject

Returns the value of attribute url.



1171
1172
1173
# File 'lib/basecamp/generated/types.rb', line 1171

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1174
1175
1176
# File 'lib/basecamp/generated/types.rb', line 1174

def self.required_fields
  %i[app_url enabled id name title url].freeze
end

Instance Method Details

#to_hObject



1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
# File 'lib/basecamp/generated/types.rb', line 1188

def to_h
  {
    "app_url" => @app_url,
    "enabled" => @enabled,
    "id" => @id,
    "name" => @name,
    "title" => @title,
    "url" => @url,
    "position" => @position,
  }.compact
end

#to_json(*args) ⇒ Object



1200
1201
1202
# File 'lib/basecamp/generated/types.rb', line 1200

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