Sha256: 298f0cd3e4050ca7c8d5b7e27d043bb84876176267595d9de9375225f7b36964

Contents?: true

Size: 611 Bytes

Versions: 3

Compression:

Stored size: 611 Bytes

Contents

class ResourceName

  RESOURCES = {
    person:      { singular: "person",      pluralized: "persons"     },
    deal:        { singular: "deal",        pluralized: "deals"       },
    note:        { singular: "note",        pluralized: "notes"       },
    activity:    { singular: "activity",    pluralized: "activities"  },
    personField: { singular: "personField", pluralized: "personFields"}
  }

  attr_reader :singular, :pluralized

  def initialize(resource)
    resource = resource.to_sym
    @singular   = RESOURCES[resource][:singular]
    @pluralized = RESOURCES[resource][:pluralized]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pipekit-webmock-0.4.5 lib/pipekit/webmock/resource_name.rb
pipekit-webmock-0.4.4 lib/pipekit/webmock/resource_name.rb
pipekit-webmock-0.4.3 lib/pipekit/webmock/resource_name.rb