Class: Informatics::Support::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/informatics/lib/informatics/support/options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options


4
5
6
# File 'lib/informatics/lib/informatics/support/options.rb', line 4

def options
  @options
end

Class Method Details

.collect(*options) ⇒ Object


6
7
8
9
10
# File 'lib/informatics/lib/informatics/support/options.rb', line 6

def self.collect(*options)
  o = new
  o.options = options
  o
end

Instance Method Details

#first_keyObject


19
20
21
# File 'lib/informatics/lib/informatics/support/options.rb', line 19

def first_key
  incoming_options.keys.first
end

#first_valueObject


23
24
25
# File 'lib/informatics/lib/informatics/support/options.rb', line 23

def first_value
  incoming_options.values.first
end

#key_is_present?(key) ⇒ Boolean

Returns:

  • (Boolean)

27
28
29
# File 'lib/informatics/lib/informatics/support/options.rb', line 27

def key_is_present?(key)
  incoming_options.key? key
end

#value_for(key) ⇒ Object


31
32
33
# File 'lib/informatics/lib/informatics/support/options.rb', line 31

def value_for(key)
  incoming_options[key]
end