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.



4102
4103
4104
4105
# File 'lib/basecamp/generated/types.rb', line 4102

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

Instance Attribute Details

#keyObject

Returns the value of attribute key.



4095
4096
4097
# File 'lib/basecamp/generated/types.rb', line 4095

def key
  @key
end

#valueObject

Returns the value of attribute value.



4095
4096
4097
# File 'lib/basecamp/generated/types.rb', line 4095

def value
  @value
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


4098
4099
4100
# File 'lib/basecamp/generated/types.rb', line 4098

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

Instance Method Details

#to_hObject



4107
4108
4109
4110
4111
4112
# File 'lib/basecamp/generated/types.rb', line 4107

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

#to_json(*args) ⇒ Object



4114
4115
4116
# File 'lib/basecamp/generated/types.rb', line 4114

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