Class: Ez::Settings::Interface::Key
- Inherits:
-
Object
- Object
- Ez::Settings::Interface::Key
- Defined in:
- lib/ez/settings/interface/key.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#required ⇒ Object
(also: #required?)
readonly
Returns the value of attribute required.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#ui ⇒ Object
(also: #ui?)
readonly
Returns the value of attribute ui.
-
#wrapper ⇒ Object
readonly
Returns the value of attribute wrapper.
Instance Method Summary collapse
-
#initialize(name, params) ⇒ Key
constructor
A new instance of Key.
Constructor Details
#initialize(name, params) ⇒ Key
Returns a new instance of Key.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ez/settings/interface/key.rb', line 10 def initialize(name, params) @name = name @group = params.fetch(:group) @interface = params.fetch(:interface) @type = params.fetch(:type, :string) @default = params.fetch(:default, -> {}).call @ui = params.fetch(:ui, true) @required = params.fetch(:required, true) @collection = params.fetch(:collection, []) @options = params.fetch(:options, {}) @suffix = params.fetch(:suffix, nil) @min = params.fetch(:min, nil) @wrapper = params.fetch(:wrapper, nil) end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def collection @collection end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def default @default end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def group @group end |
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def interface @interface end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def min @min end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def @options end |
#required ⇒ Object (readonly) Also known as: required?
Returns the value of attribute required.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def required @required end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def suffix @suffix end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def type @type end |
#ui ⇒ Object (readonly) Also known as: ui?
Returns the value of attribute ui.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def ui @ui end |
#wrapper ⇒ Object (readonly)
Returns the value of attribute wrapper.
6 7 8 |
# File 'lib/ez/settings/interface/key.rb', line 6 def wrapper @wrapper end |