Module: Crest

Defined in:
lib/crest.rb,
lib/crest/card.rb,
lib/crest/error.rb,
lib/crest/photo.rb,
lib/crest/config.rb,
lib/crest/routes.rb,
lib/crest/railtie.rb,
lib/crest/version.rb,
lib/crest/cards_controller.rb

Overview

A contact card an app hands out, so a text from an unknown number arrives under a name.

Defined Under Namespace

Modules: Routes Classes: Card, CardsController, Config, Error, Photo, Railtie

Constant Summary collapse

VERSION =

The version of this gem, as RubyGems knows it.

'1.0.1'

Class Method Summary collapse

Class Method Details

.cardCrest::Card

Built afresh for every request, since a setting stated as a callable is asked each time.

Returns:



20
21
22
23
# File 'lib/crest.rb', line 20

def self.card
  Card.new name: config.name, phone: config.phone, url: config.url, email: config.email,
           org: config.org, photo: config.photo
end

.configCrest::Config

Returns everything a card has to be told about the app around it.

Returns:

  • (Crest::Config)

    everything a card has to be told about the app around it.



12
# File 'lib/crest.rb', line 12

def self.config = @config ||= Config.new

.configure {|config| ... } ⇒ void

This method returns an undefined value.

Yields the configuration, so a host states its own facts in one initializer.

Yields:



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

def self.configure = yield config