Class: GoobyBaseObject

Inherits:
Object
  • Object
show all
Includes:
GoobyEnvironment, GoobyIO, GoobyIntrospection
Defined in:
lib/gooby_base_object.rb

Overview

Gooby = Google APIs + Ruby. Copyright 2009 by Chris Joakim. Gooby is available under GNU General Public License (GPL) license.

Constant Summary collapse

UOM_MILES =
"m"
UOM_KILOMETERS =
"k"
UOM_YARDS =
"y"
KILOMETERS_PER_MILE =
1.61290322581
YARDS_PER_MILE =
1760.0
MILES_PER_KILOMETER =
0.62
YARDS_PER_KILOMETER =
1091.2
METERS_PER_FOOT =
3.281
SECONDS_PER_HOUR =
3600.0
@@config =
nil

Class Method Summary collapse

Methods included from GoobyIO

#read_file_as_lines, #write_file, #write_lines

Methods included from GoobyIntrospection

#classname, included

Methods included from GoobyEnvironment

#array_param, #boolean_param, #command_line_arg, #float_param, #integer_param, #string_param

Class Method Details

.boolean_config_value(name) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/gooby_base_object.rb', line 38

def self.boolean_config_value(name)
  value = config_value(name)
  return false if value.nil?
  return true  if value ==  true
  return true  if value == 'true'
  false
end

.config_value(name) ⇒ Object



34
35
36
# File 'lib/gooby_base_object.rb', line 34

def self.config_value(name)
  @@config[name]
end

.get_configObject



30
31
32
# File 'lib/gooby_base_object.rb', line 30

def self.get_config
  @@config
end

.set_config(c) ⇒ Object



26
27
28
# File 'lib/gooby_base_object.rb', line 26

def self.set_config(c)
  @@config = c
end