Class: SuperSettings::Storage::StorageAttributes

Inherits:
Object
  • Object
show all
Includes:
SuperSettings::Storage
Defined in:
lib/super_settings/storage/storage_attributes.rb

Overview

Generic class that can be extended to represent a setting in memory.

Direct Known Subclasses

HttpStorage, JSONStorage, MongoDBStorage, RedisStorage

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SuperSettings::Storage

#==, #create_history, #history, included, #save!

Constructor Details

#initialize(attributes = nil) ⇒ StorageAttributes

Returns a new instance of StorageAttributes.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/super_settings/storage/storage_attributes.rb', line 11

def initialize(attributes = nil)
  @key = nil
  @raw_value = nil
  @description = nil
  @value_type = nil
  @deleted = false
  @updated_at = nil
  @created_at = nil
  @persisted = false
  super
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



9
10
11
# File 'lib/super_settings/storage/storage_attributes.rb', line 9

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/super_settings/storage/storage_attributes.rb', line 9

def description
  @description
end

#keyObject

Returns the value of attribute key.



9
10
11
# File 'lib/super_settings/storage/storage_attributes.rb', line 9

def key
  @key
end

#raw_valueObject

Returns the value of attribute raw_value.



9
10
11
# File 'lib/super_settings/storage/storage_attributes.rb', line 9

def raw_value
  @raw_value
end

#updated_atObject

Returns the value of attribute updated_at.



9
10
11
# File 'lib/super_settings/storage/storage_attributes.rb', line 9

def updated_at
  @updated_at
end

#value_typeObject

Returns the value of attribute value_type.



9
10
11
# File 'lib/super_settings/storage/storage_attributes.rb', line 9

def value_type
  @value_type
end

Instance Method Details

#deleted=(val) ⇒ Object



51
52
53
# File 'lib/super_settings/storage/storage_attributes.rb', line 51

def deleted=(val)
  @deleted = !!val
end

#deleted?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/super_settings/storage/storage_attributes.rb', line 47

def deleted?
  !!@deleted
end

#persisted=(val) ⇒ Object



59
60
61
# File 'lib/super_settings/storage/storage_attributes.rb', line 59

def persisted=(val)
  @persisted = !!val
end

#persisted?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/super_settings/storage/storage_attributes.rb', line 55

def persisted?
  !!@persisted
end