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.



1418
1419
1420
1421
1422
1423
1424
1425
1426
# File 'lib/basecamp/generated/types.rb', line 1418

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.



1411
1412
1413
# File 'lib/basecamp/generated/types.rb', line 1411

def app_url
  @app_url
end

#enabledObject

Returns the value of attribute enabled.



1411
1412
1413
# File 'lib/basecamp/generated/types.rb', line 1411

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



1411
1412
1413
# File 'lib/basecamp/generated/types.rb', line 1411

def id
  @id
end

#nameObject

Returns the value of attribute name.



1411
1412
1413
# File 'lib/basecamp/generated/types.rb', line 1411

def name
  @name
end

#positionObject

Returns the value of attribute position.



1411
1412
1413
# File 'lib/basecamp/generated/types.rb', line 1411

def position
  @position
end

#titleObject

Returns the value of attribute title.



1411
1412
1413
# File 'lib/basecamp/generated/types.rb', line 1411

def title
  @title
end

#urlObject

Returns the value of attribute url.



1411
1412
1413
# File 'lib/basecamp/generated/types.rb', line 1411

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1414
1415
1416
# File 'lib/basecamp/generated/types.rb', line 1414

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

Instance Method Details

#to_hObject



1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
# File 'lib/basecamp/generated/types.rb', line 1428

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



1440
1441
1442
# File 'lib/basecamp/generated/types.rb', line 1440

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