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.



3590
3591
3592
3593
# File 'lib/basecamp/generated/types.rb', line 3590

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

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3583
3584
3585
# File 'lib/basecamp/generated/types.rb', line 3583

def key
  @key
end

#valueObject

Returns the value of attribute value.



3583
3584
3585
# File 'lib/basecamp/generated/types.rb', line 3583

def value
  @value
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3586
3587
3588
# File 'lib/basecamp/generated/types.rb', line 3586

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

Instance Method Details

#to_hObject



3595
3596
3597
3598
3599
3600
# File 'lib/basecamp/generated/types.rb', line 3595

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

#to_json(*args) ⇒ Object



3602
3603
3604
# File 'lib/basecamp/generated/types.rb', line 3602

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