Sha256: 8330a1b6330585ffd97e78bc8e7828eb0941b193b2886ed8ec2aa6dddd79085f

Contents?: true

Size: 1021 Bytes

Versions: 20

Compression:

Stored size: 1021 Bytes

Contents

class Executable 
  include RightScale::Api::Base
  extend RightScale::Api::BaseExtend

  # executable can be EITHER a right_script or recipe
  # executable example params format:
  # can have recipes AND right_scripts
  # @params =
  #    { :recipe =>
  #      :position => 12,
  #      :apply => "operational",
  #      :right_script => { "href" => "http://blah", 
  #                         "name" => "blah" 
  #                         ...
  #      }

  def recipe?
    if self["recipe"] == nil # && right_script['href']
      return false
    end
    true
  end

  def right_script?
    if self["recipe"] == nil # && right_script['href']
      return true
    end
    false
  end

  def name
    if right_script?
      return right_script.name
    else
      return recipe
    end
  end

  def href
    if right_script? 
      return right_script.href
    else
      #recipes do not have hrefs, only names
      return recipe
    end
  end

  def right_script
    RightScript.new(@params['right_script'])
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rest_connection-0.0.23 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.22 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.21 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.20 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.19 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.18 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.17 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.16 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.15 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.14 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.13 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.12 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.11 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.10 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.9 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.8 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.7 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.6 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.5 lib/rest_connection/rightscale/executable.rb
rest_connection-0.0.4 lib/rest_connection/rightscale/executable.rb