Class: Ez::Settings::Interface::Group
- Inherits:
-
Object
- Object
- Ez::Settings::Interface::Group
- Defined in:
- lib/ez/settings/interface/group.rb
Constant Summary collapse
- OverwriteKeyError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#store(backend) ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
-
#initialize(name, interface, options = {}, &block) ⇒ Group
constructor
A new instance of Group.
- #key(key_name, params = {}) ⇒ Object
- #ui_keys ⇒ Object
Constructor Details
#initialize(name, interface, options = {}, &block) ⇒ Group
Returns a new instance of Group.
13 14 15 16 17 18 19 20 |
# File 'lib/ez/settings/interface/group.rb', line 13 def initialize(name, interface, = {}, &block) @name = name @interface = interface @options = @keys = [] instance_eval(&block) end |
Instance Attribute Details
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
11 12 13 |
# File 'lib/ez/settings/interface/group.rb', line 11 def interface @interface end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
11 12 13 |
# File 'lib/ez/settings/interface/group.rb', line 11 def keys @keys end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/ez/settings/interface/group.rb', line 11 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/ez/settings/interface/group.rb', line 11 def @options end |
#store(backend) ⇒ Object (readonly)
Returns the value of attribute store.
11 12 13 |
# File 'lib/ez/settings/interface/group.rb', line 11 def store @store end |
Instance Method Details
#key(key_name, params = {}) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/ez/settings/interface/group.rb', line 22 def key(key_name, params = {}) prevent_key_rewrite!(key_name) keys << Interface::Key.new(key_name, params.merge(group: name, interface: interface)) keys end |
#ui_keys ⇒ Object
29 30 31 |
# File 'lib/ez/settings/interface/group.rb', line 29 def ui_keys keys.select(&:ui?) end |