Class: Druid::PostAggregationField

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(name) ⇒ PostAggregationField

Returns a new instance of PostAggregationField.



71
72
73
# File 'lib/druid/post_aggregation.rb', line 71

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



69
70
71
# File 'lib/druid/post_aggregation.rb', line 69

def name
  @name
end

Instance Method Details

#as_json(*a) ⇒ Object



87
88
89
# File 'lib/druid/post_aggregation.rb', line 87

def as_json(*a)
  to_hash
end

#get_field_namesObject



75
76
77
# File 'lib/druid/post_aggregation.rb', line 75

def get_field_names
  @name
end

#to_hashObject



79
80
81
# File 'lib/druid/post_aggregation.rb', line 79

def to_hash
  { "type" => "fieldAccess", "name" => @name, "fieldName" => @name }
end

#to_json(*a) ⇒ Object



83
84
85
# File 'lib/druid/post_aggregation.rb', line 83

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