Module: JSONAPI::Serializable::ErrorDSL::ClassMethods

Defined in:
lib/jsonapi/serializable/error_dsl.rb

Instance Method Summary collapse

Instance Method Details

#code(value = nil, &block) ⇒ Object


19
20
21
22
# File 'lib/jsonapi/serializable/error_dsl.rb', line 19

def code(value = nil, &block)
  @code_val = value
  @code_block = block
end

#detail(value = nil, &block) ⇒ Object


29
30
31
32
# File 'lib/jsonapi/serializable/error_dsl.rb', line 29

def detail(value = nil, &block)
  @detail_val = value
  @detail_block = block
end

#id(value = nil, &block) ⇒ Object


9
10
11
12
# File 'lib/jsonapi/serializable/error_dsl.rb', line 9

def id(value = nil, &block)
  @id_val = value
  @id_block = block
end

39
40
41
# File 'lib/jsonapi/serializable/error_dsl.rb', line 39

def link(name, &block)
  link_blocks[name] = block
end

#meta(value = nil, &block) ⇒ Object


34
35
36
37
# File 'lib/jsonapi/serializable/error_dsl.rb', line 34

def meta(value = nil, &block)
  @meta_val = value
  @meta_block = block
end

#source(&block) ⇒ Object


43
44
45
# File 'lib/jsonapi/serializable/error_dsl.rb', line 43

def source(&block)
  self.source_block = block
end

#status(value = nil, &block) ⇒ Object


14
15
16
17
# File 'lib/jsonapi/serializable/error_dsl.rb', line 14

def status(value = nil, &block)
  @status_val = value
  @status_block = block
end

#title(value = nil, &block) ⇒ Object


24
25
26
27
# File 'lib/jsonapi/serializable/error_dsl.rb', line 24

def title(value = nil, &block)
  @title_val = value
  @title_block = block
end