Class: Timepad::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/timepad/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Timepad::Client

Initalize new API

Parameters:

  • attrs (Hash) (defaults to: {})


8
9
10
11
12
13
# File 'lib/timepad/client.rb', line 8

def initialize(attrs = {})
  attrs = Timepad.options.merge(attrs)
  Config::VALID_OPTIONS_KEYS.each do |key|
     instance_variable_set("@#{key}".to_sym, attrs[key])
  end
end

Instance Method Details

#categoryTimepad::Category

Category object

Returns:



32
33
34
# File 'lib/timepad/client.rb', line 32

def category
  @category ||= Timepad::Category.new(self)
end

#eventTimepad::Event

Event object

Returns:



39
40
41
# File 'lib/timepad/client.rb', line 39

def event
  @event ||= Timepad::Event.new(self)
end

#idObject



47
48
49
# File 'lib/timepad/client.rb', line 47

def id
  @id
end

#keyObject



43
44
45
# File 'lib/timepad/client.rb', line 43

def key
  @key
end

#mailTimepad::Mail

Return Mail object

Returns:



25
26
27
# File 'lib/timepad/client.rb', line 25

def mail
  @mail ||= Timepad::Mail.new(self)
end

#maillistTimepad::Maillist

Return Maillist object

Returns:



18
19
20
# File 'lib/timepad/client.rb', line 18

def maillist
  @maillist ||= Timepad::Maillist.new(self)
end