Module: FunWith::Configurations::ObjectMethods

Defined in:
lib/fun_with/configurations/object_methods.rb

Instance Method Summary collapse

Instance Method Details

#install_fwc_config(config = nil, &block) ⇒ Object



4
5
6
7
8
9
# File 'lib/fun_with/configurations/object_methods.rb', line 4

def install_fwc_config( config = nil, &block )
  extend FunWith::Configurations::Configurable
  self.config = config || FunWith::Configurations::Config.new( &block )
  self.config.fwc_configured_object = self
  self.config
end

#install_fwc_config_from_file(file) ⇒ Object



11
12
13
14
15
16
# File 'lib/fun_with/configurations/object_methods.rb', line 11

def install_fwc_config_from_file( file )
  config = FunWith::Configurations::Config.from_file( file )
  self.install_fwc_config( config )
  self.fwc_configuration_file = file
  self.config
end

#install_fwc_config_from_hash(hash) ⇒ Object



18
19
20
21
22
# File 'lib/fun_with/configurations/object_methods.rb', line 18

def install_fwc_config_from_hash( hash )
  config = FunWith::Configurations::Config.from_hash( hash )
  self.install_fwc_config( config )
  self.config
end

#install_fwc_config_from_yaml(yaml_string) ⇒ Object



24
25
26
27
28
# File 'lib/fun_with/configurations/object_methods.rb', line 24

def install_fwc_config_from_yaml( yaml_string )
  config = Config.from_yaml( yaml_string )
  self.install_fwc_config( config )
  self.config
end