Class: NgrokAPI::Models::ApplicationSession

Inherits:
Object
  • Object
show all
Defined in:
lib/ngrokapi/models/application_session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, attrs: {}) ⇒ ApplicationSession

Returns a new instance of ApplicationSession.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ngrokapi/models/application_session.rb', line 24

def initialize(client: nil, attrs: {})
  @client = client
  @attrs = attrs
  @id = @attrs['id']
  unless @attrs['uri'].nil?
    @uri = URI(@attrs['uri'])
  end
  unless @attrs['public_url'].nil?
    @public_url = URI(@attrs['public_url'])
  end
  @browser_session = @attrs['browser_session']
  @application_user = @attrs['application_user']
  @created_at = @attrs['created_at']
  @last_active = @attrs['last_active']
  @expires_at = @attrs['expires_at']
  @endpoint = @attrs['endpoint']
  @edge = @attrs['edge']
  @route = @attrs['route']
end

Instance Attribute Details

#application_userObject (readonly)

Returns the value of attribute application_user.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def application_user
  @application_user
end

#attrsObject (readonly)

Returns the value of attribute attrs.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def attrs
  @attrs
end

#browser_sessionObject (readonly)

Returns the value of attribute browser_session.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def browser_session
  @browser_session
end

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def client
  @client
end

#created_atObject (readonly)

Returns the value of attribute created_at.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def created_at
  @created_at
end

#edgeObject (readonly)

Returns the value of attribute edge.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def edge
  @edge
end

#endpointObject (readonly)

Returns the value of attribute endpoint.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def endpoint
  @endpoint
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def expires_at
  @expires_at
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def id
  @id
end

#last_activeObject (readonly)

Returns the value of attribute last_active.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def last_active
  @last_active
end

#public_urlObject (readonly)

Returns the value of attribute public_url.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def public_url
  @public_url
end

#routeObject (readonly)

Returns the value of attribute route.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def route
  @route
end

#uriObject (readonly)

Returns the value of attribute uri.



10
11
12
# File 'lib/ngrokapi/models/application_session.rb', line 10

def uri
  @uri
end

Instance Method Details

#==(other) ⇒ Object



44
45
46
# File 'lib/ngrokapi/models/application_session.rb', line 44

def ==(other)
  @attrs == other.attrs
end

#deleteObject

Delete an application session by ID.

https://ngrok.com/docs/api#api-application-sessions-delete



60
61
62
63
64
# File 'lib/ngrokapi/models/application_session.rb', line 60

def delete
  @client.delete(
    id: @id
  )
end

#to_hObject



52
53
54
# File 'lib/ngrokapi/models/application_session.rb', line 52

def to_h
  @attrs.to_h
end

#to_sObject



48
49
50
# File 'lib/ngrokapi/models/application_session.rb', line 48

def to_s
  @attrs.to_s
end