class Eso::Filter

Attributes

filter_items[RW]

These are the individual filter items

type[RW]

These are defined in Eso::Filters which reside in the respective service they are related to.

Public Class Methods

new(type:, items: []) click to toggle source

Constructor for Filter.

@param [String] type The type of filter this is. They are based on the service this filter exists in. These are defined in Eso::Filters which reside in the respective service they are related to. @param [Array] items Array of filters of this type @return [Eso::Filter] The newly created filter object

# File lib/eso/filter.rb, line 15
def initialize(type:, items: [])
  @type = type
  @filter_items = items
 end

Public Instance Methods

<<(filter_item) click to toggle source

Append a filter_item later

# File lib/eso/filter.rb, line 21
def <<(filter_item)
  @filter_items << filter_item
end
to_h()
Alias for: to_hash
to_hash() click to toggle source
# File lib/eso/filter.rb, line 29
def to_hash
  hash = {}
  hash[@type.to_sym] = {
    valueClass: 'Array',
    items: @filter_items.map{|item| item.to_hash}
  }
  hash
end
Also aliased as: to_h
to_json() click to toggle source
# File lib/eso/filter.rb, line 25
def to_json
  self.to_hash.to_json
end