Class: Rews::Restriction

Inherits:
Object
  • Object
show all
Defined in:
lib/rews/restriction.rb

Overview

models Restrictions for find_* operations on Folder::BaseFolderId

takes restrictions written in Ruby s-expressions and outputs Exchange Web Services Restriction XML. e.g.

[[:and, [:==, "item:Subject", "hello"], [:>=, "item:DateTimeSent", DateTime.parse("2011-03-16T15:57:37+00:00")]]

Defined Under Namespace

Modules: Xml

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expr) ⇒ Restriction

Returns a new instance of Restriction.



13
14
15
# File 'lib/rews/restriction.rb', line 13

def initialize(expr)
  @expr = expr
end

Instance Attribute Details

#exprObject (readonly)

Returns the value of attribute expr.



11
12
13
# File 'lib/rews/restriction.rb', line 11

def expr
  @expr
end

Instance Method Details

#inspectObject



17
18
19
# File 'lib/rews/restriction.rb', line 17

def inspect
  "#<#{self.class} @expr=#{@expr.inspect}>"
end

#to_xmlObject



21
22
23
# File 'lib/rews/restriction.rb', line 21

def to_xml
  Xml::write_restriction(expr)
end