Class: Basecamp::Types::SearchType
- Inherits:
-
Object
- Object
- Basecamp::Types::SearchType
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
SearchType
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ SearchType
constructor
A new instance of SearchType.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ SearchType
Returns a new instance of SearchType.
3869 3870 3871 3872 |
# File 'lib/basecamp/generated/types.rb', line 3869 def initialize(data = {}) @key = data["key"] @value = data["value"] end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
3862 3863 3864 |
# File 'lib/basecamp/generated/types.rb', line 3862 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
3862 3863 3864 |
# File 'lib/basecamp/generated/types.rb', line 3862 def value @value end |
Class Method Details
.required_fields ⇒ Array<Symbol>
3865 3866 3867 |
# File 'lib/basecamp/generated/types.rb', line 3865 def self.required_fields %i[key value].freeze end |
Instance Method Details
#to_h ⇒ Object
3874 3875 3876 3877 3878 3879 |
# File 'lib/basecamp/generated/types.rb', line 3874 def to_h { "key" => @key, "value" => @value, }.reject { |k, v| v.nil? && !["key"].include?(k) } end |
#to_json(*args) ⇒ Object
3881 3882 3883 |
# File 'lib/basecamp/generated/types.rb', line 3881 def to_json(*args) to_h.to_json(*args) end |