Method: Stellar::DSL.Account

Defined in:
lib/stellar/dsl.rb

.Account(subject = nil) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/stellar/dsl.rb', line 30

def (subject = nil)
  case subject
  when 
    subject
  when /^M[A-Z0-9]{68}$/
    .from_address(subject.to_str)
  when nil
    .random
  else
    begin
      keypair = KeyPair(subject)

      .new(keypair)
    rescue TypeError
      raise TypeError, "Cannot convert #{subject.inspect} to Stellar::Account"
    end
  end
end