Class: Leash::Integrations::Namespace

Inherits:
Object
  • Object
show all
Defined in:
lib/leash/integrations.rb

Overview

‘leash.integrations` — typed provider namespaces plus a generic `.provider(name)` escape hatch for un-typed providers (Slack, GitHub, HubSpot, Jira, …). Mirrors the TS `leash.integrations` namespace and the Python `IntegrationsNamespace`.

Method aliases keep the TS provider names addressable:

leash.integrations.calendar         # canonical (matches TS shape)
leash.integrations.google_calendar  # alias for calendar
leash.integrations.drive            # canonical
leash.integrations.google_drive     # alias for drive

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ Namespace

Returns a new instance of Namespace.



23
24
25
26
27
28
29
# File 'lib/leash/integrations.rb', line 23

def initialize(transport)
  @transport = transport
  @gmail = Gmail.new(transport)
  @calendar = Calendar.new(transport)
  @drive = Drive.new(transport)
  @linear = Linear.new(transport)
end

Instance Attribute Details

#calendarObject (readonly) Also known as: google_calendar

Returns the value of attribute calendar.



31
32
33
# File 'lib/leash/integrations.rb', line 31

def calendar
  @calendar
end

#driveObject (readonly) Also known as: google_drive

Returns the value of attribute drive.



31
32
33
# File 'lib/leash/integrations.rb', line 31

def drive
  @drive
end

#gmailObject (readonly)

Returns the value of attribute gmail.



31
32
33
# File 'lib/leash/integrations.rb', line 31

def gmail
  @gmail
end

#linearObject (readonly)

Returns the value of attribute linear.



31
32
33
# File 'lib/leash/integrations.rb', line 31

def linear
  @linear
end

Instance Method Details

#provider(name) ⇒ Object

Generic escape hatch — ‘leash.integrations.provider(’slack’).call(…)‘.



39
40
41
# File 'lib/leash/integrations.rb', line 39

def provider(name)
  Caller.new(@transport, name)
end