class ResourceKitling::Action
Attributes
name[R]
Public Class Methods
new(name)
click to toggle source
# File lib/resource_kitling.rb, line 20 def initialize(name) @name = name @verb = :get @version = 'v1' @path = path end
Public Instance Methods
generated_path(values = {})
click to toggle source
# File lib/resource_kitling.rb, line 44 def generated_path(values = {}) values.inject("/#{version}/#{path}") do |np, (key, value)| np.gsub(":#{key}", value.to_s) end end
path(path = nil, &block)
click to toggle source
# File lib/resource_kitling.rb, line 37 def path(path = nil, &block) raise "You must pass either a block or a string for paths" if path and block_given? @path = path if path @path = block if block_given? @path end
to_s()
click to toggle source
# File lib/resource_kitling.rb, line 50 def to_s name end
verb(v = nil)
click to toggle source
# File lib/resource_kitling.rb, line 27 def verb(v = nil) @verb = v if v @verb end
version(v = nil)
click to toggle source
# File lib/resource_kitling.rb, line 32 def version(v = nil) @version = v if v @version end