Class: Thrift::StructDefinition
- Inherits:
-
Object
- Object
- Thrift::StructDefinition
- Defined in:
- lib/thrift/definition.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #canonical_names ⇒ Object
-
#initialize(klass) ⇒ StructDefinition
constructor
A new instance of StructDefinition.
- #legacy_annotations ⇒ Object
- #name ⇒ Object
- #namespace ⇒ Object
- #struct_type ⇒ Object
- #structured_annotations ⇒ Object
Constructor Details
#initialize(klass) ⇒ StructDefinition
Returns a new instance of StructDefinition.
13 14 15 |
# File 'lib/thrift/definition.rb', line 13 def initialize(klass) @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
11 12 13 |
# File 'lib/thrift/definition.rb', line 11 def klass @klass end |
Instance Method Details
#canonical_names ⇒ Object
41 42 43 44 45 |
# File 'lib/thrift/definition.rb', line 41 def canonical_names CANONICAL_NAME_EXTRACTORS.reduce([]) do |acc, cur| acc + cur.extract(self) end end |
#legacy_annotations ⇒ Object
23 24 25 26 27 |
# File 'lib/thrift/definition.rb', line 23 def legacy_annotations return {} unless @klass.const_defined? :LEGACY_ANNOTATIONS @klass::LEGACY_ANNOTATIONS end |
#name ⇒ Object
33 34 35 |
# File 'lib/thrift/definition.rb', line 33 def name @klass::NAME end |
#namespace ⇒ Object
29 30 31 |
# File 'lib/thrift/definition.rb', line 29 def namespace @klass::NAMESPACE end |
#struct_type ⇒ Object
37 38 39 |
# File 'lib/thrift/definition.rb', line 37 def struct_type "#{namespace}.#{name}" end |
#structured_annotations ⇒ Object
17 18 19 20 21 |
# File 'lib/thrift/definition.rb', line 17 def structured_annotations return [] unless @klass.const_defined? :STRUCTURED_ANNOTATIONS @klass::STRUCTURED_ANNOTATIONS end |