class Norikra::Client::Field

Public Instance Methods

add(target, field, type) click to toggle source
# File lib/norikra/client/cli.rb, line 181
def add(target, field, type)
  wrap do
    client(parent_options).reserve(target, field, type)
  end
end
list(target) click to toggle source
# File lib/norikra/client/cli.rb, line 169
def list(target)
  wrap do
    puts "FIELD\tTYPE\tOPTIONAL" unless options[:simple]
    fields = client(parent_options).fields(target)
    fields.each do |f|
      puts "#{f['name']}\t#{f['type']}\t#{f['optional']}"
    end
    puts "#{fields.size} fields found." unless options[:simple]
  end
end