Class: Druid::PostAggregationConstant

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PostAggregationConstant

Returns a new instance of PostAggregationConstant.



95
96
97
# File 'lib/druid/post_aggregation.rb', line 95

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



93
94
95
# File 'lib/druid/post_aggregation.rb', line 93

def value
  @value
end

Instance Method Details

#as_json(*a) ⇒ Object



107
108
109
# File 'lib/druid/post_aggregation.rb', line 107

def as_json(*a)
  to_hash
end

#to_hashObject



99
100
101
# File 'lib/druid/post_aggregation.rb', line 99

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

#to_json(*a) ⇒ Object



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

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