Class: Aquel::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/aquel/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Attribute

Returns a new instance of Attribute.



5
6
7
8
# File 'lib/aquel/attribute.rb', line 5

def initialize(options)
  @name = options[:name]
  @value = options[:value]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/aquel/attribute.rb', line 3

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/aquel/attribute.rb', line 3

def value
  @value
end

Instance Method Details

#operate(target) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/aquel/attribute.rb', line 10

def operate(target)
  case name
  when '='
    target == value
  when '<>'
    target != value
  else
    false
  end
end