Class: Consumer::Controls::Session::Example

Inherits:
Object
  • Object
show all
Includes:
Configure, Settings::Setting
Defined in:
lib/consumer/controls/session.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(settings = nil) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/consumer/controls/session.rb', line 17

def self.build(settings=nil)
  settings ||= Settings.example

  instance = new
  settings.set(instance)
  instance
end

Instance Method Details

#==(other_session) ⇒ Object



30
31
32
33
34
# File 'lib/consumer/controls/session.rb', line 30

def ==(other_session)
  other_session.is_a?(self.class) &&
    self.some_setting == other_session.some_setting &&
    self.other_setting == other_session.other_setting
end

#settings?(other_settings) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/consumer/controls/session.rb', line 25

def settings?(other_settings)
  self.some_setting == other_settings.get(:some_setting) &&
    self.other_setting == other_settings.get(:other_setting)
end