Class: ResourceName

Inherits:
Object
  • Object
show all
Defined in:
lib/pipekit/webmock/resource_name.rb

Constant Summary collapse

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"}
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ ResourceName

Returns a new instance of ResourceName.



13
14
15
16
17
# File 'lib/pipekit/webmock/resource_name.rb', line 13

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

Instance Attribute Details

#pluralizedObject (readonly)

Returns the value of attribute pluralized.



11
12
13
# File 'lib/pipekit/webmock/resource_name.rb', line 11

def pluralized
  @pluralized
end

#singularObject (readonly)

Returns the value of attribute singular.



11
12
13
# File 'lib/pipekit/webmock/resource_name.rb', line 11

def singular
  @singular
end