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.



2171
2172
2173
2174
2175
# File 'lib/basecamp/generated/types.rb', line 2171

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.



2164
2165
2166
# File 'lib/basecamp/generated/types.rb', line 2164

def color
  @color
end

#descriptionObject

Returns the value of attribute description.



2164
2165
2166
# File 'lib/basecamp/generated/types.rb', line 2164

def description
  @description
end

#positionObject

Returns the value of attribute position.



2164
2165
2166
# File 'lib/basecamp/generated/types.rb', line 2164

def position
  @position
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


2167
2168
2169
# File 'lib/basecamp/generated/types.rb', line 2167

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

Instance Method Details

#to_hObject



2177
2178
2179
2180
2181
2182
2183
# File 'lib/basecamp/generated/types.rb', line 2177

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

#to_json(*args) ⇒ Object



2185
2186
2187
# File 'lib/basecamp/generated/types.rb', line 2185

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