Class: Pinspec::SetupStep

Inherits:
Data
  • Object
show all
Defined in:
lib/pinspec/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



124
125
126
# File 'lib/pinspec/types.rb', line 124

def kind
  @kind
end

#payloadObject (readonly)

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



124
125
126
# File 'lib/pinspec/types.rb', line 124

def payload
  @payload
end

Instance Method Details

#refObject



125
126
127
# File 'lib/pinspec/types.rb', line 125

def ref
  payload[:name]
end

#to_sObject



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/pinspec/types.rb', line 129

def to_s
  case kind
  when :freeze_time       then "freeze_time #{payload[:at]}"
  when :seed_random       then "seed_random #{payload[:seed]}"
  when :set_locale        then "set_locale #{payload[:locale].inspect}"
  when :set_zone          then "set_zone #{payload[:zone].inspect}"
  when :set_flag          then "set_flag #{payload[:flag].inspect} = #{payload[:enabled]}"
  when :create_record     then "create_record #{payload[:name]} <- #{create_source}"
  when :import_record     then "import_record #{payload[:name]} <- #{payload[:source]}"
  when :set_tenant        then "set_tenant #{payload[:record_ref]}"
  when :stub_current      then "stub_current #{payload[:kind]} #{payload[:record_ref]}"
  when :set_whodunnit     then "set_whodunnit #{payload[:record_ref]}"
  when :construct_subject then "construct_subject #{payload[:class]} (#{payload[:kind]})"
  end
end