class Kodmin::Plugins::HmacAuth

Plugin: hmac-auth

Constants

NAME

Attributes

config[RW]

Public Class Methods

new(attrs = {}) click to toggle source
# File lib/kodmin/plugins/hmac_auth.rb, line 33
def initialize(attrs = {})
  form_hash(attrs)
end

Public Instance Methods

form_hash(attrs = {}) click to toggle source

Assign attributes from Hash. @param attrs [Hash] attributes in Hash object.

# File lib/kodmin/plugins/hmac_auth.rb, line 49
def form_hash(attrs = {})
  attrs.each_key do |key|
    if key.to_sym == :config
      self.config = HmacAuth::Config.new(attrs[key])
    else
      setter = "#{key}=".to_sym
      send(setter, attrs[key]) if respond_to?(setter)
    end
  end
end
name() click to toggle source
# File lib/kodmin/plugins/hmac_auth.rb, line 37
def name
  HmacAuth::NAME
end
to_hash() click to toggle source
Calls superclass method
# File lib/kodmin/plugins/hmac_auth.rb, line 41
def to_hash
  hash = super
  hash[:config] = config.to_hash unless config.nil?
  hash
end