Class: Ez::Settings::Interface::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/ez/settings/interface/key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#collectionObject (readonly)

Returns the value of attribute collection.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def collection
  @collection
end

#defaultObject (readonly)

Returns the value of attribute default.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def default
  @default
end

#groupObject (readonly)

Returns the value of attribute group.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def group
  @group
end

#interfaceObject (readonly)

Returns the value of attribute interface.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def interface
  @interface
end

#minObject (readonly)

Returns the value of attribute min.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def min
  @min
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def options
  @options
end

#requiredObject (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

#suffixObject (readonly)

Returns the value of attribute suffix.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def suffix
  @suffix
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def type
  @type
end

#uiObject (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

#wrapperObject (readonly)

Returns the value of attribute wrapper.



6
7
8
# File 'lib/ez/settings/interface/key.rb', line 6

def wrapper
  @wrapper
end