Class: Jbuilder::Schema::Template::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/jbuilder/schema/template.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(object: nil, object_title: nil, object_description: nil) ⇒ Object



28
29
30
# File 'lib/jbuilder/schema/template.rb', line 28

def self.build(object: nil, object_title: nil, object_description: nil, **)
  new(object: object, title: object_title, description: object_description)
end

Instance Method Details

#descriptionObject



36
37
38
# File 'lib/jbuilder/schema/template.rb', line 36

def description
  super || translate(Jbuilder::Schema.description_name)
end

#titleObject



32
33
34
# File 'lib/jbuilder/schema/template.rb', line 32

def title
  super || translate(Jbuilder::Schema.title_name)
end

#translate_description(key) ⇒ Object



44
45
46
# File 'lib/jbuilder/schema/template.rb', line 44

def translate_description(key)
  translate("fields.#{key}.#{Jbuilder::Schema.description_name}")
end

#translate_title(key) ⇒ Object



40
41
42
# File 'lib/jbuilder/schema/template.rb', line 40

def translate_title(key)
  translate("fields.#{key}.#{Jbuilder::Schema.title_name}")
end