Skip to content

pjc0247/roap_vd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

roap_vd

roap data validation extension

class Foo
  # @restrictions
  #   id       => length(0..32), regex([a-zA-Z0-9]+)
  #   password => length(32)
  def login id, password
    # ....
  end
end

가독성을 위해 하나의 파라미터에 대한 제약사항들을 여러줄에 걸쳐 작성할 수 있습니다.

class Foo
  # @restrictions
  #   id       => length(0..32)
  #               nullable
  #               typeof(String)
  #   password => length(32)
  #               nullable
  #               within(["a", "b", "c"])
  def foo id
  end
end
  • typeof(Class)
  • length(Range)
  • length(Fixnum)
  • regex(Regex)
  • nullable
  • within(Array)
  • within(Range)
  • equal(Object)

About

roap validation extension

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages