Sha256: c61f3155031627fc25a150c0ce6609ef4b7d3bb9a8b4fdcfc1279e55540bc8c6

Contents?: true

Size: 789 Bytes

Versions: 94

Compression:

Stored size: 789 Bytes

Contents

class Product
  # TODO: return instances
  def self.all
    raise "Application requires 'products.yml' inside /config folder in documentation path" unless defined?("#{Rails.configuration.docs_base_path}/config/products.yml")

    config = YAML.safe_load(File.open("#{Rails.configuration.docs_base_path}/config/products.yml"))

    config['products']
  end

  def self.normalize_title(product)
    return 'SMS' if product == 'messaging/sms'
    return 'Voice' if product == 'voice/voice-api'
    return 'Number Insight' if product == 'number-insight'
    return 'Messages' if product == 'messages'
    return 'Dispatch' if product == 'dispatch'
    return 'Client SDK' if product == 'client-sdk'
    return 'Subaccounts' if product == 'account/subaccounts'

    product.camelcase
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
station-0.4.6 lib/nexmo_developer/app/models/product.rb
station-0.4.5 lib/nexmo_developer/app/models/product.rb
station-0.4.4 lib/nexmo_developer/app/models/product.rb
station-0.4.3 lib/nexmo_developer/app/models/product.rb
station-0.4.2 lib/nexmo_developer/app/models/product.rb
station-0.4.1 lib/nexmo_developer/app/models/product.rb
station-0.4.0 lib/nexmo_developer/app/models/product.rb
station-0.3.2 lib/nexmo_developer/app/models/product.rb
station-0.3.1 lib/nexmo_developer/app/models/product.rb
station-0.3.0 lib/nexmo_developer/app/models/product.rb
station-0.2.6 lib/nexmo_developer/app/models/product.rb
station-0.2.5 lib/nexmo_developer/app/models/product.rb
station-0.2.4 lib/nexmo_developer/app/models/product.rb
station-0.2.3 lib/nexmo_developer/app/models/product.rb
station-0.2.2 lib/nexmo_developer/app/models/product.rb
station-0.2.1 lib/nexmo_developer/app/models/product.rb
station-0.2.0 lib/nexmo_developer/app/models/product.rb
station-0.1.8 lib/nexmo_developer/app/models/product.rb
station-0.1.7 lib/nexmo_developer/app/models/product.rb
station-0.1.6 lib/nexmo_developer/app/models/product.rb