Class: Brief::DocumentMapper::Selector

Inherits:
Object
  • Object
show all
Defined in:
lib/brief/document_mapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Selector

Returns a new instance of Selector.



21
22
23
24
25
26
27
# File 'lib/brief/document_mapper.rb', line 21

def initialize(opts = {})
  unless Brief::DocumentMapper::VALID_OPERATORS.include?(opts[:operator])
    fail 'Operator not supported'
  end

  @attribute, @operator = opts[:attribute], opts[:operator]
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



19
20
21
# File 'lib/brief/document_mapper.rb', line 19

def attribute
  @attribute
end

#operatorObject (readonly)

Returns the value of attribute operator.



19
20
21
# File 'lib/brief/document_mapper.rb', line 19

def operator
  @operator
end