Class: Factor::Connector::WebHookBuilder
- Inherits:
-
Object
- Object
- Factor::Connector::WebHookBuilder
- Defined in:
- lib/builders/web_hook_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
- #id(val) ⇒ Object
-
#initialize(vals = {}, &block) ⇒ WebHookBuilder
constructor
A new instance of WebHookBuilder.
- #method(val) ⇒ Object
- #start(&code) ⇒ Object
Constructor Details
#initialize(vals = {}, &block) ⇒ WebHookBuilder
Returns a new instance of WebHookBuilder.
7 8 9 10 11 |
# File 'lib/builders/web_hook_builder.rb', line 7 def initialize(vals = {}, &block) @id = vals[:id].to_s @method = vals[:method] || 'POST' instance_eval(&block) if block end |
Instance Method Details
#build ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/builders/web_hook_builder.rb', line 25 def build wd = WebHookDefinition.new wd.id = @id wd.method = @method wd.start = @start wd end |
#id(val) ⇒ Object
13 14 15 |
# File 'lib/builders/web_hook_builder.rb', line 13 def id(val) @id = val.to_s end |
#method(val) ⇒ Object
17 18 19 |
# File 'lib/builders/web_hook_builder.rb', line 17 def method(val) @method = val end |
#start(&code) ⇒ Object
21 22 23 |
# File 'lib/builders/web_hook_builder.rb', line 21 def start(&code) @start = code end |