Class: BreweryDB::WebHook
- Inherits:
-
Object
- Object
- BreweryDB::WebHook
- Defined in:
- lib/brewery_db/web_hook.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#attribute_id ⇒ Object
readonly
Returns the value of attribute attribute_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
-
#sub_action ⇒ Object
readonly
Returns the value of attribute sub_action.
-
#sub_attribute_id ⇒ Object
readonly
Returns the value of attribute sub_attribute_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(args) ⇒ WebHook
constructor
A new instance of WebHook.
- #valid?(api_key) ⇒ Boolean
Constructor Details
#initialize(args) ⇒ WebHook
Returns a new instance of WebHook.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/brewery_db/web_hook.rb', line 14 def initialize(args) @action = args[:action] @attribute = args[:attribute] @attribute_id = args[:attributeId] @key = args[:key] @nonce = args[:nonce] @sub_action = args[:subAction] @sub_attribute_id = args[:subAttributeId] @timestamp = args[:timestamp] end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/brewery_db/web_hook.rb', line 5 def action @action end |
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
6 7 8 |
# File 'lib/brewery_db/web_hook.rb', line 6 def attribute @attribute end |
#attribute_id ⇒ Object (readonly)
Returns the value of attribute attribute_id.
7 8 9 |
# File 'lib/brewery_db/web_hook.rb', line 7 def attribute_id @attribute_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/brewery_db/web_hook.rb', line 8 def key @key end |
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
9 10 11 |
# File 'lib/brewery_db/web_hook.rb', line 9 def nonce @nonce end |
#sub_action ⇒ Object (readonly)
Returns the value of attribute sub_action.
10 11 12 |
# File 'lib/brewery_db/web_hook.rb', line 10 def sub_action @sub_action end |
#sub_attribute_id ⇒ Object (readonly)
Returns the value of attribute sub_attribute_id.
11 12 13 |
# File 'lib/brewery_db/web_hook.rb', line 11 def sub_attribute_id @sub_attribute_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
12 13 14 |
# File 'lib/brewery_db/web_hook.rb', line 12 def @timestamp end |
Instance Method Details
#valid?(api_key) ⇒ Boolean
25 26 27 |
# File 'lib/brewery_db/web_hook.rb', line 25 def valid?(api_key) hash(api_key) == key end |