Class: Capybarista::Session

Inherits:
Object
  • Object
show all
Includes:
Extensions::Session, Finders
Defined in:
lib/capybarista.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Extensions::Session

#new_label_list

Methods included from Extensions::Base

#all_fields

Methods included from Finders

#all, #find, #find_button, #find_by_id, #find_field, #find_link, #first

Constructor Details

#initialize(capybara_session) ⇒ Session

Returns a new instance of Session.



46
47
48
# File 'lib/capybarista.rb', line 46

def initialize(capybara_session)
  @basis = capybara_session
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



66
67
68
# File 'lib/capybarista.rb', line 66

def method_missing(name, *args, &block)
  @basis.public_send(name, *args, &block)
end

Instance Attribute Details

#basisObject (readonly)

Returns the value of attribute basis.



44
45
46
# File 'lib/capybarista.rb', line 44

def basis
  @basis
end

Class Method Details

.for(input) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/capybarista.rb', line 50

def self.for(input)
  if input.is_a? Capybarista::Session
    return input
  else
    return Capybarista::Session.new input
  end
end

Instance Method Details

#within(input, *args, &block) ⇒ Object



59
60
61
62
# File 'lib/capybarista.rb', line 59

def within(input, *args, &block)
  input = Capybarista::Element.unwrap(input)
  @basis.within(input, *args, &block)
end