Class: Ez::Settings::Interface
- Inherits:
-
Object
- Object
- Ez::Settings::Interface
- Includes:
- Configurator
- Defined in:
- lib/ez/settings/interface.rb,
lib/ez/settings/interface/key.rb,
lib/ez/settings/interface/group.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Class Method Summary collapse
Instance Method Summary collapse
- #define(&block) ⇒ Object
- #group(name, options = {}, &block) ⇒ Object
-
#initialize(name) ⇒ Interface
constructor
A new instance of Interface.
- #keys ⇒ Object
Constructor Details
#initialize(name) ⇒ Interface
Returns a new instance of Interface.
33 34 35 36 37 |
# File 'lib/ez/settings/interface.rb', line 33 def initialize(name) @name = name @keys = [] @groups = [] end |
Instance Attribute Details
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
31 32 33 |
# File 'lib/ez/settings/interface.rb', line 31 def groups @groups end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/ez/settings/interface.rb', line 31 def name @name end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
31 32 33 |
# File 'lib/ez/settings/interface.rb', line 31 def store @store end |
Class Method Details
.define(name, &block) ⇒ Object
23 24 25 26 27 |
# File 'lib/ez/settings/interface.rb', line 23 def self.define(name, &block) interface = new(name) interface.instance_eval(&block) interface end |
Instance Method Details
#define(&block) ⇒ Object
39 40 41 |
# File 'lib/ez/settings/interface.rb', line 39 def define(&block) instance_eval(&block) end |
#group(name, options = {}, &block) ⇒ Object
43 44 45 |
# File 'lib/ez/settings/interface.rb', line 43 def group(name, = {}, &block) find_or_initialize_group(name, , &block) end |
#keys ⇒ Object
47 48 49 |
# File 'lib/ez/settings/interface.rb', line 47 def keys groups.map(&:keys).flatten end |