Class: Dryer::Clients::ApiDescriptions::Resources::GenerateName
- Inherits:
-
Services::SimpleService
- Object
- Services::SimpleService
- Dryer::Clients::ApiDescriptions::Resources::GenerateName
- Defined in:
- lib/dryer/clients/api_descriptions/resources/generate_name.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(resource) ⇒ GenerateName
constructor
A new instance of GenerateName.
Constructor Details
#initialize(resource) ⇒ GenerateName
Returns a new instance of GenerateName.
8 9 10 |
# File 'lib/dryer/clients/api_descriptions/resources/generate_name.rb', line 8 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
20 21 22 |
# File 'lib/dryer/clients/api_descriptions/resources/generate_name.rb', line 20 def resource @resource end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/dryer/clients/api_descriptions/resources/generate_name.rb', line 12 def call resource[:url] .split("/") .reject { |part| part.start_with?(":") } .reject { |part| part.empty? } .join("_") end |