Class: Configuration

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/twitter/cli/models/configuration.rb

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



4
5
6
7
# File 'lib/twitter/cli/models/configuration.rb', line 4

def self.[](key)
  key = find_by_key(key.to_s)
  key.nil? ? nil : key.data
end

.[]=(key, data) ⇒ Object



9
10
11
12
# File 'lib/twitter/cli/models/configuration.rb', line 9

def self.[]=(key, data)
  c = find_or_create_by_key(key.to_s)
  c.update_attribute :data, data
end