Class: Qadmin::OptionSet
- Inherits:
-
Array
- Object
- Array
- Qadmin::OptionSet
- Defined in:
- lib/qadmin/option_set.rb
Instance Method Summary collapse
- #current ⇒ Object
-
#initialize(*args) ⇒ OptionSet
constructor
A new instance of OptionSet.
Constructor Details
#initialize(*args) ⇒ OptionSet
Returns a new instance of OptionSet.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/qadmin/option_set.rb', line 4 def initialize(*args) first = args.shift if first.is_a?(Array) self.default = first = args.shift else = first end if .is_a?(Hash) .each do |option, value| self.send("#{option}=", value) end end end |
Instance Method Details
#current ⇒ Object
19 20 21 |
# File 'lib/qadmin/option_set.rb', line 19 def current [self].flatten.dup end |