Class: Talktome::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/talktome/client.rb,
lib/talktome/client/local.rb

Direct Known Subclasses

Local

Defined Under Namespace

Classes: Local

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(folder, options = {}) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:

Raises:

  • (ArgumentError)


4
5
6
7
8
9
10
# File 'lib/talktome/client.rb', line 4

def initialize(folder, options = {})
  raise ArgumentError, "Missing root folder" unless folder
  raise ArgumentError, "Invalid root folder" unless Path(folder).directory?
  @folder = folder
  @options = Talktome.auto_options(folder).merge(options)
  yield self if block_given?
end

Instance Attribute Details

#folderObject (readonly)

Returns the value of attribute folder.



11
12
13
# File 'lib/talktome/client.rb', line 11

def folder
  @folder
end

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/talktome/client.rb', line 11

def options
  @options
end

Instance Method Details

#strategy(name, stragegy) ⇒ Object



13
14
15
# File 'lib/talktome/client.rb', line 13

def strategy(name, stragegy)
  strategies[name] = stragegy
end