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.
-
#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.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#ui ⇒ Object
(also: #ui?)
readonly
Returns the value of attribute ui.
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.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ez/settings/interface/key.rb', line 7 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, []) = params.fetch(:options, {}) end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def collection @collection end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def default @default end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def group @group end |
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def interface @interface end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def end |
#required ⇒ Object (readonly) Also known as: required?
Returns the value of attribute required.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def required @required end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def type @type end |
#ui ⇒ Object (readonly) Also known as: ui?
Returns the value of attribute ui.
4 5 6 |
# File 'lib/ez/settings/interface/key.rb', line 4 def ui @ui end |