Class: Dbla::Response::Facets::FacetItem
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Dbla::Response::Facets::FacetItem
- Defined in:
- lib/dbla/response/facets.rb
Instance Method Summary collapse
- #as_json(props = nil) ⇒ Object
-
#initialize(*args) ⇒ FacetItem
constructor
A new instance of FacetItem.
- #label ⇒ Object
Constructor Details
#initialize(*args) ⇒ FacetItem
Returns a new instance of FacetItem.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/dbla/response/facets.rb', line 41 def initialize *args = args. # Backwards-compat method signature value = args.shift hits = args.shift [:value] = value if value [:hits] = hits if hits super() end |
Instance Method Details
#as_json(props = nil) ⇒ Object
58 59 60 |
# File 'lib/dbla/response/facets.rb', line 58 def as_json(props = nil) table.as_json(props) end |
#label ⇒ Object
54 55 56 |
# File 'lib/dbla/response/facets.rb', line 54 def label super || value end |