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.



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, [])
  @options    = params.fetch(:options, {})
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



4
5
6
# File 'lib/ez/settings/interface/key.rb', line 4

def collection
  @collection
end

#defaultObject (readonly)

Returns the value of attribute default.



4
5
6
# File 'lib/ez/settings/interface/key.rb', line 4

def default
  @default
end

#groupObject (readonly)

Returns the value of attribute group.



4
5
6
# File 'lib/ez/settings/interface/key.rb', line 4

def group
  @group
end

#interfaceObject (readonly)

Returns the value of attribute interface.



4
5
6
# File 'lib/ez/settings/interface/key.rb', line 4

def interface
  @interface
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/ez/settings/interface/key.rb', line 4

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/ez/settings/interface/key.rb', line 4

def options
  @options
end

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

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/ez/settings/interface/key.rb', line 4

def type
  @type
end

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