Class: Sunnytrail
- Inherits:
-
Object
show all
- Defined in:
- lib/sunnytrail.rb
Defined Under Namespace
Classes: ConfigurationError, Event
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(init_options = {}) ⇒ Sunnytrail
39
40
41
42
|
# File 'lib/sunnytrail.rb', line 39
def initialize(init_options={})
@options = Sunnytrail.options.merge(init_options)
raise ConfigurationError, "API KEY not set" if @options[:api_key].nil?
end
|
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
11
12
13
|
# File 'lib/sunnytrail.rb', line 11
def options
@options
end
|
Class Method Details
.add_event(args = {}) ⇒ Object
30
31
32
33
|
# File 'lib/sunnytrail.rb', line 30
def add_event(args={})
sunny_trail = Sunnytrail.new
sunny_trail.add_event(args)
end
|
17
18
19
20
21
22
23
24
|
# File 'lib/sunnytrail.rb', line 17
def configure(options = {})
default_options = {
:api_url => "api.thesunnytrail.com",
:api_key => nil,
:use_ssl => true
}
@options = default_options.merge(options)
end
|
.options ⇒ Object
26
27
28
|
# File 'lib/sunnytrail.rb', line 26
def options
@options ||= {}
end
|
Instance Method Details
#add_event(args = {}) ⇒ Object
44
45
46
|
# File 'lib/sunnytrail.rb', line 44
def add_event(args={})
request args
end
|