Class: Azure::ServiceBus::Resource
- Inherits:
-
Object
- Object
- Azure::ServiceBus::Resource
- Defined in:
- lib/azure/service_bus/resource.rb
Direct Known Subclasses
Queue, Relay, Rule, Subscription, Topic
Instance Attribute Summary collapse
-
#author_name ⇒ Object
Public: Get the author name.
-
#description ⇒ Object
Public: Resource description.
-
#id ⇒ Object
(also: #url)
Get the Resource’s ID.
-
#name ⇒ Object
(also: #title)
Get the Resource’s name.
-
#published ⇒ Object
Public: Get the published time.
-
#updated ⇒ Object
Public: Get the updated time.
Instance Method Summary collapse
- #get_props ⇒ Object
-
#initialize(name, description = {}) {|_self| ... } ⇒ Resource
constructor
Public: Initialize the resource (either queue, topic, rule or subscription).
Constructor Details
#initialize(name, description = {}) {|_self| ... } ⇒ Resource
Public: Initialize the resource (either queue, topic, rule or subscription).
name - A String with the name of the resource. description - The resource description Hash
25 26 27 28 29 |
# File 'lib/azure/service_bus/resource.rb', line 25 def initialize(name, description = {}) @name = name @description = description yield self if block_given? end |
Instance Attribute Details
#author_name ⇒ Object
Public: Get the author name
Returns a String
56 57 58 |
# File 'lib/azure/service_bus/resource.rb', line 56 def @author_name end |
#description ⇒ Object
Public: Resource description
Returns a Hash
61 62 63 |
# File 'lib/azure/service_bus/resource.rb', line 61 def description @description end |
#id ⇒ Object Also known as: url
Get the Resource’s ID.
Returns a URI.
34 35 36 |
# File 'lib/azure/service_bus/resource.rb', line 34 def id @id end |
#name ⇒ Object Also known as: title
Get the Resource’s name.
Returns a String.
40 41 42 |
# File 'lib/azure/service_bus/resource.rb', line 40 def name @name end |
#published ⇒ Object
Public: Get the published time
Returns a Time
46 47 48 |
# File 'lib/azure/service_bus/resource.rb', line 46 def published @published end |
#updated ⇒ Object
Public: Get the updated time
Returns a Time
51 52 53 |
# File 'lib/azure/service_bus/resource.rb', line 51 def updated @updated end |
Instance Method Details
#get_props ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/azure/service_bus/resource.rb', line 63 def get_props desc = description.dup props = [] ordered_props.each { |prop_name| if desc[prop_name] props.push [prop_name, desc[prop_name]] desc.delete prop_name end } desc.each { |k,v| props.push [k, v] } props end |