Module: NinjaVan
- Defined in:
- lib/ninja_van.rb,
lib/ninja_van/error.rb,
lib/ninja_van/order.rb,
lib/ninja_van/types.rb,
lib/ninja_van/config.rb,
lib/ninja_van/request.rb,
lib/ninja_van/version.rb,
lib/ninja_van/access_token.rb,
lib/ninja_van/flexible_params.rb
Defined Under Namespace
Modules: Validations
Classes: AccessToken, BadParamsError, Config, ConfigError, CreateOrderError, Dimensions, Error, FlexibleParams, ForbiddenError, NotFoundError, Order, PickupApproxVolumes, PickupServiceLevels, PickupServiceTypes, Request, RequestError, ResponseError, ServerError, ServiceLevels, ServiceTypes, Timezones
Constant Summary
collapse
- VERSION =
"1.0.1"
Class Method Summary
collapse
Class Method Details
.is_blank?(object) ⇒ Boolean
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/ninja_van.rb', line 21
def self.is_blank?(object)
case object
when NilClass, FalseClass
return true
when TrueClass, Numeric, Fixnum
return false
when Array, Hash
return object.empty?
when String
return object.empty? || !object.match(/\A[[:space:]]*\z/).nil?
else
return object.respond_to?(:empty?) ? !!object.empty? : !object
end
end
|
.setup {|@config| ... } ⇒ Object
15
16
17
18
19
|
# File 'lib/ninja_van.rb', line 15
def self.setup
@config ||= NinjaVan::Config.new
yield @config if block_given?
@config
end
|