Class: ResourceName
- Inherits:
-
Object
- Object
- ResourceName
- 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
-
#pluralized ⇒ Object
readonly
Returns the value of attribute pluralized.
-
#singular ⇒ Object
readonly
Returns the value of attribute singular.
Instance Method Summary collapse
-
#initialize(resource) ⇒ ResourceName
constructor
A new instance of ResourceName.
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
#pluralized ⇒ Object (readonly)
Returns the value of attribute pluralized.
11 12 13 |
# File 'lib/pipekit/webmock/resource_name.rb', line 11 def pluralized @pluralized end |
#singular ⇒ Object (readonly)
Returns the value of attribute singular.
11 12 13 |
# File 'lib/pipekit/webmock/resource_name.rb', line 11 def singular @singular end |