Class: WebhookAction
- Inherits:
-
Object
- Object
- WebhookAction
- Defined in:
- lib/macrohub.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(idx = nil, id: idx, url: '127.0.0.1', env: {debug: false}) ⇒ WebhookAction
constructor
A new instance of WebhookAction.
- #invoke ⇒ Object
- #to_node ⇒ Object
- #to_rowx ⇒ Object
Constructor Details
#initialize(idx = nil, id: idx, url: '127.0.0.1', env: {debug: false}) ⇒ WebhookAction
Returns a new instance of WebhookAction.
47 48 49 50 51 |
# File 'lib/macrohub.rb', line 47 def initialize(idx=nil, id: idx, url: '127.0.0.1', env: {debug: false}) @name, @url = id, url end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
45 46 47 |
# File 'lib/macrohub.rb', line 45 def url @url end |
Instance Method Details
#invoke ⇒ Object
53 54 55 |
# File 'lib/macrohub.rb', line 53 def invoke() "webhook: %s" % @url end |
#to_node ⇒ Object
57 58 59 60 |
# File 'lib/macrohub.rb', line 57 def to_node() Rexle::Element.new(:action, \ attributes: {type: :webhook, name: @name, url: @url}) end |
#to_rowx ⇒ Object
62 63 64 65 |
# File 'lib/macrohub.rb', line 62 def to_rowx() s = "action: webhook %s" % @name s += "\n url: %s" % @url end |