Class: Druid::PostAggregationConstant

Inherits:
Object
  • Object
show all
Includes:
PostAggregationOperators
Defined in:
lib/druid/post_aggregation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PostAggregationOperators

#*, #+, #-, #/

Constructor Details

#initialize(value) ⇒ PostAggregationConstant

Returns a new instance of PostAggregationConstant.



105
106
107
# File 'lib/druid/post_aggregation.rb', line 105

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



103
104
105
# File 'lib/druid/post_aggregation.rb', line 103

def value
  @value
end

Instance Method Details

#as_json(*a) ⇒ Object



117
118
119
# File 'lib/druid/post_aggregation.rb', line 117

def as_json(*a)
  to_hash
end

#to_hashObject



109
110
111
# File 'lib/druid/post_aggregation.rb', line 109

def to_hash
  { "type" => "constant", "value" => @value }
end

#to_json(*a) ⇒ Object



113
114
115
# File 'lib/druid/post_aggregation.rb', line 113

def to_json(*a)
  to_hash.to_json(*a)
end