2013-08-23 02:21:52 -04:00
|
|
|
class Plugin::AuthProvider
|
2015-09-25 11:29:05 -04:00
|
|
|
|
|
|
|
def self.auth_attributes
|
|
|
|
[:glyph, :background_color, :title, :message, :frame_width, :frame_height, :authenticator,
|
|
|
|
:title_setting, :enabled_setting]
|
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor(*auth_attributes)
|
2013-08-25 21:04:16 -04:00
|
|
|
|
2013-08-25 22:52:36 -04:00
|
|
|
def name
|
|
|
|
authenticator.name
|
|
|
|
end
|
|
|
|
|
2015-09-25 11:29:05 -04:00
|
|
|
def to_json
|
|
|
|
result = {name: name}
|
|
|
|
result['titleOverride'] = title if title
|
|
|
|
result['titleSetting'] = title_setting if title_setting
|
|
|
|
result['enabledSetting'] = enabled_setting if enabled_setting
|
|
|
|
result['messageOverride'] = message if message
|
|
|
|
result['frameWidth'] = frame_width if frame_width
|
|
|
|
result['frameHeight'] = frame_height if frame_height
|
|
|
|
result.to_json
|
|
|
|
end
|
|
|
|
|
2013-08-23 02:21:52 -04:00
|
|
|
end
|