lib/ethon/easy/options.rb in ethon-0.5.0 vs lib/ethon/easy/options.rb in ethon-0.5.1
- old
+ new
@@ -1,10 +1,12 @@
module Ethon
class Easy
# This module contains the logic and knowledge about the
# available options on easy.
+ #
+ # @api private
module Options
# :nodoc:
def self.included(base)
base.extend ClassMethods
@@ -84,10 +86,16 @@
# of bool_options, enum_options and int_options.
#
# @example Return casted the value.
# easy.value_for(:verbose)
#
+ # @param [ Symbol ] option The option to get the value from.
+ #
# @return [ Object ] The casted value.
+ #
+ # @raise [ Ethon::Errors::InvalidValue ] If specified option
+ # points to an enum and the value doen't correspond to
+ # the valid values.
def value_for(option)
value = method(option).call
return nil if value.nil?
if self.class.bool_options.include?(option)