Class: NDFD::Client::SelectionAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/ndfd/client/query/selection_attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ SelectionAttributes

Returns a new instance of SelectionAttributes.


8
9
10
# File 'lib/ndfd/client/query/selection_attributes.rb', line 8

def initialize(attributes)
  @attributes = Array.wrap(attributes)
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes


6
7
8
# File 'lib/ndfd/client/query/selection_attributes.rb', line 6

def attributes
  @attributes
end

Instance Method Details

#valid?(attr) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
15
16
# File 'lib/ndfd/client/query/selection_attributes.rb', line 12

def valid?(attr)
  unless attributes.include?(attr)
    raise NDFD::Client::InvalidSelectionAttributeError, "The selection attribute, `#{attr}`, is not a valid attribute on this query."
  end
end