Class: Azure::ServiceBus::Rule
- Defined in:
- lib/azure/service_bus/rule.rb
Instance Attribute Summary collapse
-
#subscription ⇒ Object
Returns the value of attribute subscription.
-
#topic ⇒ Object
Returns the value of attribute topic.
Attributes inherited from Resource
#author_name, #description, #id, #name, #published, #updated
Instance Method Summary collapse
-
#action ⇒ Object
Action: String.
- #action=(val) ⇒ Object
-
#filter ⇒ Object
Filter: SqlFilter, TrueFilter /FalseFiilter, CorrelationFilter.
- #filter=(val) ⇒ Object
-
#initialize(name, options = {}) ⇒ Rule
constructor
Public: Initialize the rule.
- #ordered_props ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(name, options = {}) ⇒ Rule
Public: Initialize the rule.
Attributes
-
name
- A String with the name of the rule. -
options
- The resource options Hash
Options
Accepted key/value pairs in options parameter are:
-
:filter
- String. The rule filter. -
:action
- String. The rule action.
46 47 48 49 50 51 52 |
# File 'lib/azure/service_bus/rule.rb', line 46 def initialize(name, = {}) = {} ["Filter"] = [:filter] if .has_key?(:filter) ["Action"] = [:action] if .has_key?(:action) super(name, ) end |
Instance Attribute Details
#subscription ⇒ Object
Returns the value of attribute subscription.
31 32 33 |
# File 'lib/azure/service_bus/rule.rb', line 31 def subscription @subscription end |
#topic ⇒ Object
Returns the value of attribute topic.
30 31 32 |
# File 'lib/azure/service_bus/rule.rb', line 30 def topic @topic end |
Instance Method Details
#action ⇒ Object
Action: String
The Action property references an instance of FilterAction. The following type of FilterAction are provided. Default is an instance of EmptyRuleAction.
SqlFilterAction - A type of FilterAction that is represented by SQL expression. For detailed information about
SqlFilterAction syntax, see SqlRuleAction.SqlExpression Property.
EmptyRuleAction - A type of FilterAction that represents an empty action.
82 83 84 |
# File 'lib/azure/service_bus/rule.rb', line 82 def action RuleAspect.from_hash(description['Action']) end |
#action=(val) ⇒ Object
86 87 88 |
# File 'lib/azure/service_bus/rule.rb', line 86 def action=(val) description['Action'] = val.to_hash end |
#filter ⇒ Object
Filter: SqlFilter, TrueFilter /FalseFiilter, CorrelationFilter
The Filter property references an instance of Filter that is evaluated against a message. The following types of filters are provided:
SqlFilter - A type of Filter that is represented by SQL expression. For detailed information about SqlFilter
syntax, see SqlFilter.SqlExpression Property.
TrueFilter/FalseFiilter - A handy shortcut for always returning true or false. They are a type of SqlFilter.
CorrelationFilter: A type of Filter that matches CorrelationId property of BrokeredMessage.
65 66 67 |
# File 'lib/azure/service_bus/rule.rb', line 65 def filter RuleAspect.from_hash(description['Filter']) end |
#filter=(val) ⇒ Object
69 70 71 |
# File 'lib/azure/service_bus/rule.rb', line 69 def filter=(val) description['Filter'] = val.to_hash end |
#ordered_props ⇒ Object
90 91 92 93 94 95 |
# File 'lib/azure/service_bus/rule.rb', line 90 def ordered_props [ 'Filter', 'Action' ] end |