class DiningTable::Presenters::HTMLPresenterConfiguration::TagsConfiguration
Constants
- TAGS
Public Class Methods
from_hash( hash )
click to toggle source
# File lib/dining-table/presenters/html_presenter_configuration.rb, line 86 def self.from_hash( hash ) new.merge_hash( hash ) end
new()
click to toggle source
# File lib/dining-table/presenters/html_presenter_configuration.rb, line 64 def initialize TAGS.each do |tag| self.send("#{ tag }=", TagConfiguration.new) end end
Public Instance Methods
initialize_copy( source )
click to toggle source
for deep dup
# File lib/dining-table/presenters/html_presenter_configuration.rb, line 91 def initialize_copy( source ) TAGS.each do |tag| self.send("#{ tag }=", source.send( tag ).dup) end end
merge_hash( hash )
click to toggle source
# File lib/dining-table/presenters/html_presenter_configuration.rb, line 77 def merge_hash( hash ) return self if !hash tags = hash[ :tags ] TAGS.each do |tag| self.send("#{ tag }").merge_hash( tags[ tag ] ) end if tags self end
to_h()
click to toggle source
# File lib/dining-table/presenters/html_presenter_configuration.rb, line 70 def to_h hashes = TAGS.map do |identifier| self.send(identifier).to_h end { :tags => Hash[ TAGS.zip( hashes ) ] } end