lib/activehook/hook.rb in activehook-0.1.8 vs lib/activehook/hook.rb in activehook-0.1.9

- old
+ new

@@ -1,9 +1,7 @@ module ActiveHook class Hook - alias :read_attribute_for_serialization :send - attr_accessor :token, :uri, :id, :key, :retry_max, :retry_time, :created_at attr_reader :errors, :payload def initialize(options = {}) options = defaults.merge(options) @@ -56,10 +54,14 @@ retry_max: @retry_max, uri: @uri, payload: @payload }.to_json end + def as_json(_options) + to_json + end + def final_payload { hook_id: @id, hook_key: @key, hook_time: @created_at, hook_signature: ActiveHook.config.signature_header, @@ -71,13 +73,9 @@ end def valid? validate! @errors.empty? - end - - def self.model_name - @_model_name ||= ActiveModel::Name.new(self) end private def save_hook