Class: WebhookAction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#urlObject

Returns the value of attribute url.



45
46
47
# File 'lib/macrohub.rb', line 45

def url
  @url
end

Instance Method Details

#invokeObject



53
54
55
# File 'lib/macrohub.rb', line 53

def invoke()
  "webhook: %s" % @url
end

#to_nodeObject



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_rowxObject



62
63
64
65
# File 'lib/macrohub.rb', line 62

def to_rowx()
  s = "action: webhook %s" %  @name
  s += "\n  url: %s" % @url
end