Class: Basecamp::Types::GaugeNeedlePayload

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

Overview

GaugeNeedlePayload

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ GaugeNeedlePayload

Returns a new instance of GaugeNeedlePayload.



2011
2012
2013
2014
2015
# File 'lib/basecamp/generated/types.rb', line 2011

def initialize(data = {})
  @position = parse_integer(data["position"])
  @color = data["color"]
  @description = data["description"]
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



2004
2005
2006
# File 'lib/basecamp/generated/types.rb', line 2004

def color
  @color
end

#descriptionObject

Returns the value of attribute description.



2004
2005
2006
# File 'lib/basecamp/generated/types.rb', line 2004

def description
  @description
end

#positionObject

Returns the value of attribute position.



2004
2005
2006
# File 'lib/basecamp/generated/types.rb', line 2004

def position
  @position
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


2007
2008
2009
# File 'lib/basecamp/generated/types.rb', line 2007

def self.required_fields
  %i[position].freeze
end

Instance Method Details

#to_hObject



2017
2018
2019
2020
2021
2022
2023
# File 'lib/basecamp/generated/types.rb', line 2017

def to_h
  {
    "position" => @position,
    "color" => @color,
    "description" => @description,
  }.compact
end

#to_json(*args) ⇒ Object



2025
2026
2027
# File 'lib/basecamp/generated/types.rb', line 2025

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