Class: ODDB::YusStub

Inherits:
Object show all
Defined in:
src/model/user.rb,
test/test_model/user.rb

Constant Summary

YUS_SERVER =
FlexMock.new 'yus_server'

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (YusStub) initialize(yus_name)

A new instance of YusStub



34
35
36
# File 'src/model/user.rb', line 34

def initialize yus_name
  @yus_name = yus_name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(key)



39
40
41
42
43
44
45
# File 'src/model/user.rb', line 39

def method_missing key
  YUS_SERVER.autosession(YUS_DOMAIN) { |session|
    session.get_entity_preference(@yus_name, key)
  }
rescue Yus::YusError
  # user not found
end

Instance Attribute Details

- (Object) yus_name (readonly) Also known as: contact_email, invoice_email

Returns the value of attribute yus_name



33
34
35
# File 'src/model/user.rb', line 33

def yus_name
  @yus_name
end

Instance Method Details

- (Object) ==(other) Also known as: eql?



46
47
48
# File 'src/model/user.rb', line 46

def == other
  other.is_a?(YusStub) && @yus_name == other.yus_name
end