Class: Crest::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/crest/config.rb

Overview

Every fact about the app a card is handed out by, so none of the gem's own classes names one. A host states each as a value or as something callable, and a callable is asked every time a card is drawn: an app reading its number out of the environment differs between production and staging, and one read at boot would be wrong in one of them until a restart.

Instance Attribute Summary collapse

Instance Attribute Details

#emailString

Returns address somebody may write back to, left out of the card where unset.

Returns:

  • (String)

    address somebody may write back to, left out of the card where unset.



22
# File 'lib/crest/config.rb', line 22

def email = resolve @email

#nameString

Returns name the card is saved under, which the gem cannot invent.

Returns:

  • (String)

    name the card is saved under, which the gem cannot invent.



13
# File 'lib/crest/config.rb', line 13

def name = resolve(@name) || missing('name')

#orgString

Returns organization the name stands for, left out of the card where unset.

Returns:

  • (String)

    organization the name stands for, left out of the card where unset.



25
# File 'lib/crest/config.rb', line 25

def org = resolve @org

#phoneString

Returns number a text of ours arrives from, which the gem cannot invent.

Returns:

  • (String)

    number a text of ours arrives from, which the gem cannot invent.



16
# File 'lib/crest/config.rb', line 16

def phone = resolve(@phone) || missing('phone')

#photoString, Pathname

Returns picture the card carries, left out of the card where unset.

Returns:

  • (String, Pathname)

    picture the card carries, left out of the card where unset.



28
# File 'lib/crest/config.rb', line 28

def photo = resolve @photo

#urlString

Returns address of the site behind the name, left out of the card where unset.

Returns:

  • (String)

    address of the site behind the name, left out of the card where unset.



19
# File 'lib/crest/config.rb', line 19

def url = resolve @url