Class: Typekit::Connection::Request

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/typekit/connection/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, parameters: {}) ⇒ Request

Returns a new instance of Request.



11
12
13
14
15
# File 'lib/typekit/connection/request.rb', line 11

def initialize(action:, parameters: {})
  @action = action
  @parameters = parameters
  @path = []
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



8
9
10
# File 'lib/typekit/connection/request.rb', line 8

def action
  @action
end

#nodeObject (readonly)

Returns the value of attribute node.



8
9
10
# File 'lib/typekit/connection/request.rb', line 8

def node
  @node
end

#parametersObject (readonly)

Returns the value of attribute parameters.



8
9
10
# File 'lib/typekit/connection/request.rb', line 8

def parameters
  @parameters
end

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/typekit/connection/request.rb', line 8

def path
  @path
end

Instance Method Details

#addressObject



17
18
19
# File 'lib/typekit/connection/request.rb', line 17

def address
  @path.map(&:to_s).join('/')
end

#sign(node) ⇒ Object



21
22
23
# File 'lib/typekit/connection/request.rb', line 21

def sign(node)
  @node = node
end