Class: Informatics::Support::Options

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

Overview

rubocop:todo Style/Documentation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options.


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

def options
  @options
end

Class Method Details

.collect(*options) ⇒ Object


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

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

Instance Method Details

#first_keyObject


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

def first_key
  incoming_options.keys.first
end

#first_valueObject


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

def first_value
  incoming_options.values.first
end

#key_is_present?(key) ⇒ Boolean

Returns:

  • (Boolean)

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

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

#value_for(key) ⇒ Object


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

def value_for(key)
  incoming_options[key]
end