class Formatter::Model

Public Class Methods

new(attributes) click to toggle source
# File lib/petro/formatter/model.rb, line 4
def initialize(attributes)
  @attributes = attributes.fetch('attributes', [])
end

Public Instance Methods

attributes() click to toggle source
# File lib/petro/formatter/model.rb, line 8
def attributes
  build_code
end

Private Instance Methods

build_code() click to toggle source
# File lib/petro/formatter/model.rb, line 14
def build_code
  @attributes.map do |att|
    "#{att.first}:#{(att.last || 'string')}"
  end.compact.join(' ')
end