Class: Gapic::Presenters::MessagePresenter
Overview
A presenter for proto messages.
Instance Attribute Summary collapse
Instance Method Summary
collapse
#ensure_absolute_namespace, #fix_namespace, #ruby_namespace, #ruby_namespace_for_address
Constructor Details
Returns a new instance of MessagePresenter.
36
37
38
39
40
|
# File 'lib/gapic/presenters/message_presenter.rb', line 36
def initialize api, message
@api = api
@message = message
@type = "message"
end
|
Instance Attribute Details
#type ⇒ String
Returns String representation of this presenter type.
30
31
32
|
# File 'lib/gapic/presenters/message_presenter.rb', line 30
def type
@type
end
|
Instance Method Details
#default_value ⇒ Object
54
55
56
|
# File 'lib/gapic/presenters/message_presenter.rb', line 54
def default_value
"{}"
end
|
#doc_description ⇒ Object
50
51
52
|
# File 'lib/gapic/presenters/message_presenter.rb', line 50
def doc_description
@message.
end
|
#doc_types ⇒ Object
46
47
48
|
# File 'lib/gapic/presenters/message_presenter.rb', line 46
def doc_types
type_name_full
end
|
#fields ⇒ Object
62
63
64
|
# File 'lib/gapic/presenters/message_presenter.rb', line 62
def fields
@fields = @message.fields.map { |f| FieldPresenter.new @api, @message, f }
end
|
#is_deprecated? ⇒ Boolean
Returns Whether the message is marked as deprecated.
77
78
79
|
# File 'lib/gapic/presenters/message_presenter.rb', line 77
def is_deprecated?
@message.is_deprecated?
end
|
#name ⇒ Object
42
43
44
|
# File 'lib/gapic/presenters/message_presenter.rb', line 42
def name
@message.name
end
|
#nested_enums ⇒ Object
66
67
68
|
# File 'lib/gapic/presenters/message_presenter.rb', line 66
def nested_enums
@nested_enums ||= @message.nested_enums.map { |e| EnumPresenter.new e }
end
|
#nested_messages ⇒ Object
70
71
72
|
# File 'lib/gapic/presenters/message_presenter.rb', line 70
def nested_messages
@nested_messages ||= @message.nested_messages.map { |m| MessagePresenter.new @api, m }
end
|
#type_name_full ⇒ Object
58
59
60
|
# File 'lib/gapic/presenters/message_presenter.rb', line 58
def type_name_full
message_ruby_type @message
end
|