Class: OpenMarket::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/open_market/configuration.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

CONFIGURATION_OPTIONS =
[:id, :password, :program_id, :short_code]

Instance Method Summary collapse

Instance Method Details

#short_code=(arg) ⇒ Object

Raises:



24
25
26
27
28
# File 'lib/open_market/configuration.rb', line 24

def short_code=(arg)
  raise Error, "short_code cannot be blank" if arg.nil?
  raise Error, "short_code must be a 5-digit number" unless arg.to_s.scan(/\A[0-9]{5}\z/)
  @short_code = arg
end