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.



1232
1233
1234
1235
1236
1237
1238
1239
1240
# File 'lib/basecamp/generated/types.rb', line 1232

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.



1225
1226
1227
# File 'lib/basecamp/generated/types.rb', line 1225

def app_url
  @app_url
end

#enabledObject

Returns the value of attribute enabled.



1225
1226
1227
# File 'lib/basecamp/generated/types.rb', line 1225

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



1225
1226
1227
# File 'lib/basecamp/generated/types.rb', line 1225

def id
  @id
end

#nameObject

Returns the value of attribute name.



1225
1226
1227
# File 'lib/basecamp/generated/types.rb', line 1225

def name
  @name
end

#positionObject

Returns the value of attribute position.



1225
1226
1227
# File 'lib/basecamp/generated/types.rb', line 1225

def position
  @position
end

#titleObject

Returns the value of attribute title.



1225
1226
1227
# File 'lib/basecamp/generated/types.rb', line 1225

def title
  @title
end

#urlObject

Returns the value of attribute url.



1225
1226
1227
# File 'lib/basecamp/generated/types.rb', line 1225

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1228
1229
1230
# File 'lib/basecamp/generated/types.rb', line 1228

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

Instance Method Details

#to_hObject



1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/basecamp/generated/types.rb', line 1242

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



1254
1255
1256
# File 'lib/basecamp/generated/types.rb', line 1254

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