Class: Netfira::WebConnect::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/netfira/web_connect/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(defaults = nil) ⇒ Configuration

Returns a new instance of Configuration.



9
10
11
# File 'lib/netfira/web_connect/configuration.rb', line 9

def initialize(defaults = nil)
  defaults.each{ |k, v| __send__ :"#{k}=", v } if defaults
end

Instance Attribute Details

#amqpObject

Returns the value of attribute amqp.



7
8
9
# File 'lib/netfira/web_connect/configuration.rb', line 7

def amqp
  @amqp
end

#authenticatorObject

Returns the value of attribute authenticator.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def authenticator
  @authenticator
end

#custom_fieldsObject

Returns the value of attribute custom_fields.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def custom_fields
  @custom_fields
end

#dbObject

Returns the value of attribute db.



7
8
9
# File 'lib/netfira/web_connect/configuration.rb', line 7

def db
  @db
end

#db_table_prefixObject

Returns the value of attribute db_table_prefix.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def db_table_prefix
  @db_table_prefix
end

#file_storeObject

Returns the value of attribute file_store.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def file_store
  @file_store
end

#http_notificationsObject

Returns the value of attribute http_notifications.



7
8
9
# File 'lib/netfira/web_connect/configuration.rb', line 7

def http_notifications
  @http_notifications
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/netfira/web_connect/configuration.rb', line 7

def logger
  @logger
end

#materialize_when_db_changedObject

Returns the value of attribute materialize_when_db_changed.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def materialize_when_db_changed
  @materialize_when_db_changed
end

#paranoiaObject

Returns the value of attribute paranoia.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def paranoia
  @paranoia
end

#session_lifetimeObject

Returns the value of attribute session_lifetime.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def session_lifetime
  @session_lifetime
end

#time_zoneObject

Returns the value of attribute time_zone.



4
5
6
# File 'lib/netfira/web_connect/configuration.rb', line 4

def time_zone
  @time_zone
end

Instance Method Details

#on_authenticate(proc = nil, &block) ⇒ Object



13
14
15
16
17
# File 'lib/netfira/web_connect/configuration.rb', line 13

def on_authenticate(proc = nil, &block)
  authenticator = proc || block
  raise 'Authenticator must take exactly two arguments (shop ID and password)' unless authenticator.arity == 2
  self.authenticator = authenticator
end