Class: Textoken::Options
- Inherits:
-
Object
- Object
- Textoken::Options
- Defined in:
- lib/textoken/options.rb
Overview
Creates collection array, checks basic hash format. Responds to collection as an array of options sorted by priority. Does not raise an exception when options are nil
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #collection ⇒ Object
-
#initialize(opt) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(opt) ⇒ Options
Returns a new instance of Options.
8 9 10 11 12 |
# File 'lib/textoken/options.rb', line 8 def initialize(opt) @options = opt @collection = [] end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/textoken/options.rb', line 6 def @options end |
Instance Method Details
#collection ⇒ Object
14 15 16 17 18 |
# File 'lib/textoken/options.rb', line 14 def collection .each { |k, v| init_option(k, v) } if sort_collection @collection end |