Class: Basecamp::Types::SearchType

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

Overview

SearchType

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ SearchType

Returns a new instance of SearchType.



3557
3558
3559
3560
# File 'lib/basecamp/generated/types.rb', line 3557

def initialize(data = {})
  @key = data["key"]
  @value = data["value"]
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3550
3551
3552
# File 'lib/basecamp/generated/types.rb', line 3550

def key
  @key
end

#valueObject

Returns the value of attribute value.



3550
3551
3552
# File 'lib/basecamp/generated/types.rb', line 3550

def value
  @value
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3553
3554
3555
# File 'lib/basecamp/generated/types.rb', line 3553

def self.required_fields
  %i[key value].freeze
end

Instance Method Details

#to_hObject



3562
3563
3564
3565
3566
3567
# File 'lib/basecamp/generated/types.rb', line 3562

def to_h
  {
    "key" => @key,
    "value" => @value,
  }.reject { |k, v| v.nil? && !["key"].include?(k) }
end

#to_json(*args) ⇒ Object



3569
3570
3571
# File 'lib/basecamp/generated/types.rb', line 3569

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