Class: Browserctl::FlowContext

Inherits:
Object
  • Object
show all
Defined in:
lib/browserctl/flow.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page:, params:, client: nil) ⇒ FlowContext

Returns a new instance of FlowContext.



15
16
17
18
19
# File 'lib/browserctl/flow.rb', line 15

def initialize(page:, params:, client: nil)
  @page   = page
  @client = client
  @params = params
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



21
22
23
24
25
# File 'lib/browserctl/flow.rb', line 21

def method_missing(name, *args)
  return @params[name] if args.empty? && @params.key?(name)

  super
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



13
14
15
# File 'lib/browserctl/flow.rb', line 13

def client
  @client
end

#pageObject (readonly)

Returns the value of attribute page.



13
14
15
# File 'lib/browserctl/flow.rb', line 13

def page
  @page
end

#paramsObject (readonly)

Returns the value of attribute params.



13
14
15
# File 'lib/browserctl/flow.rb', line 13

def params
  @params
end

Instance Method Details

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/browserctl/flow.rb', line 27

def respond_to_missing?(name, include_private = false)
  @params.key?(name) || super
end