Method: Inspec::Attribute#to_ruby
- Defined in:
- lib/inspec/objects/attribute.rb
#to_ruby ⇒ Object
82 83 84 85 86 87 88 89 |
# File 'lib/inspec/objects/attribute.rb', line 82 def to_ruby res = ["#{ruby_var_identifier} = attribute('#{@name}',{"] res.push " title: '#{title}'," unless title.to_s.empty? res.push " default: #{default.inspect}," unless default.to_s.empty? res.push " description: '#{description}'," unless description.to_s.empty? res.push '})' res.join("\n") end |