Class: Elasticsearch::API::Response::Description
- Inherits:
-
Object
- Object
- Elasticsearch::API::Response::Description
- Defined in:
- lib/elasticsearch/api/response/description.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(raw:, type:, operator:, operation: nil, field: nil, value: nil) ⇒ Description
constructor
A new instance of Description.
Constructor Details
#initialize(raw:, type:, operator:, operation: nil, field: nil, value: nil) ⇒ Description
Returns a new instance of Description.
7 8 9 10 11 12 13 14 |
# File 'lib/elasticsearch/api/response/description.rb', line 7 def initialize(raw:, type:, operator:, operation: nil, field: nil, value: nil) @raw = raw @type = type @operator = operator @operation = operation @field = field @value = value end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
5 6 7 |
# File 'lib/elasticsearch/api/response/description.rb', line 5 def field @field end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
5 6 7 |
# File 'lib/elasticsearch/api/response/description.rb', line 5 def operation @operation end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
5 6 7 |
# File 'lib/elasticsearch/api/response/description.rb', line 5 def operator @operator end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/elasticsearch/api/response/description.rb', line 5 def raw @raw end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/elasticsearch/api/response/description.rb', line 5 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/elasticsearch/api/response/description.rb', line 5 def value @value end |
Instance Method Details
#as_json ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/api/response/description.rb', line 16 def as_json { type: type, operator: operator, operation: operation, field: field, value: value }.delete_if { |k, v| v.nil? } end |