View Source ExCrawlzy.Client.Handlers.Fields (ExCrawlzy v0.1.1)

Internal module to handle json fields, mainly helps to create modules with defined keys on compile

add to the module the use and use the macro add_field/3

defmodule Some.Module do
  use ExCrawlzy.Client.Handlers.Fields

  add_field(:name, "a.mr-1 span.repo", :text)
  ...

and adds the function fields/0 to the module

> Some.Module.fields()
%{name: {"a.mr-1 span.repo", :text}}

Summary

Functions

Add the params in the inner data, all are saved on the module and you can get the whole data using the function fields/0

Functions

Link to this macro

add_field(field_name, selector, func)

View Source (macro)

Add the params in the inner data, all are saved on the module and you can get the whole data using the function fields/0