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.



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

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



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

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.



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

def client
  @client
end

#pageObject (readonly)

Returns the value of attribute page.



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

def page
  @page
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

Instance Method Details

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

Returns:

  • (Boolean)


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

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