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.



1599
1600
1601
1602
1603
# File 'lib/basecamp/generated/types.rb', line 1599

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.



1592
1593
1594
# File 'lib/basecamp/generated/types.rb', line 1592

def color
  @color
end

#descriptionObject

Returns the value of attribute description.



1592
1593
1594
# File 'lib/basecamp/generated/types.rb', line 1592

def description
  @description
end

#positionObject

Returns the value of attribute position.



1592
1593
1594
# File 'lib/basecamp/generated/types.rb', line 1592

def position
  @position
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1595
1596
1597
# File 'lib/basecamp/generated/types.rb', line 1595

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

Instance Method Details

#to_hObject



1605
1606
1607
1608
1609
1610
1611
# File 'lib/basecamp/generated/types.rb', line 1605

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

#to_json(*args) ⇒ Object



1613
1614
1615
# File 'lib/basecamp/generated/types.rb', line 1613

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