Class: Basecamp::Types::Gauge

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

Overview

Gauge

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Gauge

Returns a new instance of Gauge.



1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
# File 'lib/basecamp/generated/types.rb', line 1881

def initialize(data = {})
  @created_at = parse_datetime(data["created_at"])
  @id = parse_integer(data["id"])
  @updated_at = parse_datetime(data["updated_at"])
  @app_url = data["app_url"]
  @bookmark_url = data["bookmark_url"]
  @bucket = parse_type(data["bucket"], "RecordingBucket")
  @creator = parse_type(data["creator"], "Person")
  @description = data["description"]
  @description_attachments = parse_array(data["description_attachments"], "RichTextAttachment")
  @enabled = parse_boolean(data["enabled"])
  @inherits_status = parse_boolean(data["inherits_status"])
  @last_needle_color = data["last_needle_color"]
  @last_needle_position = parse_integer(data["last_needle_position"])
  @previous_needle_position = parse_integer(data["previous_needle_position"])
  @status = data["status"]
  @title = data["title"]
  @type = data["type"]
  @url = data["url"]
  @visible_to_clients = parse_boolean(data["visible_to_clients"])
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def app_url
  @app_url
end

#bookmark_urlObject

Returns the value of attribute bookmark_url.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def bookmark_url
  @bookmark_url
end

#bucketObject

Returns the value of attribute bucket.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def bucket
  @bucket
end

#created_atObject

Returns the value of attribute created_at.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def created_at
  @created_at
end

#creatorObject

Returns the value of attribute creator.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def creator
  @creator
end

#descriptionObject

Returns the value of attribute description.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def description
  @description
end

#description_attachmentsObject

Returns the value of attribute description_attachments.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def description_attachments
  @description_attachments
end

#enabledObject

Returns the value of attribute enabled.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def id
  @id
end

#inherits_statusObject

Returns the value of attribute inherits_status.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def inherits_status
  @inherits_status
end

#last_needle_colorObject

Returns the value of attribute last_needle_color.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def last_needle_color
  @last_needle_color
end

#last_needle_positionObject

Returns the value of attribute last_needle_position.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def last_needle_position
  @last_needle_position
end

#previous_needle_positionObject

Returns the value of attribute previous_needle_position.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def previous_needle_position
  @previous_needle_position
end

#statusObject

Returns the value of attribute status.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def status
  @status
end

#titleObject

Returns the value of attribute title.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def title
  @title
end

#typeObject

Returns the value of attribute type.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def url
  @url
end

#visible_to_clientsObject

Returns the value of attribute visible_to_clients.



1874
1875
1876
# File 'lib/basecamp/generated/types.rb', line 1874

def visible_to_clients
  @visible_to_clients
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1877
1878
1879
# File 'lib/basecamp/generated/types.rb', line 1877

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

Instance Method Details

#to_hObject



1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
# File 'lib/basecamp/generated/types.rb', line 1903

def to_h
  {
    "created_at" => @created_at,
    "id" => @id,
    "updated_at" => @updated_at,
    "app_url" => @app_url,
    "bookmark_url" => @bookmark_url,
    "bucket" => @bucket,
    "creator" => @creator,
    "description" => @description,
    "description_attachments" => @description_attachments,
    "enabled" => @enabled,
    "inherits_status" => @inherits_status,
    "last_needle_color" => @last_needle_color,
    "last_needle_position" => @last_needle_position,
    "previous_needle_position" => @previous_needle_position,
    "status" => @status,
    "title" => @title,
    "type" => @type,
    "url" => @url,
    "visible_to_clients" => @visible_to_clients,
  }.compact
end

#to_json(*args) ⇒ Object



1927
1928
1929
# File 'lib/basecamp/generated/types.rb', line 1927

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