class Kodmin::Plugins::Plugin
Basic definition of plugin.
Attributes
created_at[RW]
enabled[RW]
id[RW]
name[R]
protocols[RW]
Public Class Methods
new(attributes = {})
click to toggle source
# File lib/kodmin/plugins/plugin.rb, line 8 def initialize(attributes = {}) from_hash(attributes) end
Public Instance Methods
from_hash(attributes)
click to toggle source
# File lib/kodmin/plugins/plugin.rb, line 12 def from_hash(attributes) attributes.each_key do |key| setter = "#{key}=".to_sym send(setter, attributes[key]) if respond_to?(setter) end end
to_hash()
click to toggle source
# File lib/kodmin/plugins/plugin.rb, line 19 def to_hash hash = {} hash[:name] = name unless name.nil? hash[:id] = id unless nil.nil? hash[:created_at] = created_at unless created_at.nil? hash[:protocols] = protocols unless protocols.nil? hash[:enabled] = enabled unless enabled.nil? hash[:tags] = tags unless tags.nil? hash end