Class: ActiveRemote::Serializers::Protobuf::Field
- Inherits:
-
Object
- Object
- ActiveRemote::Serializers::Protobuf::Field
- Defined in:
- lib/active_remote/serializers/protobuf.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
-
.from_attribute(field, value) ⇒ Object
Class methods.
Instance Method Summary collapse
-
#from_attribute ⇒ Object
Instance methods.
-
#initialize(field, value) ⇒ Field
constructor
Constructor!.
Constructor Details
#initialize(field, value) ⇒ Field
Constructor!
79 80 81 82 |
# File 'lib/active_remote/serializers/protobuf.rb', line 79 def initialize(field, value) @field = field @value = value end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
74 75 76 |
# File 'lib/active_remote/serializers/protobuf.rb', line 74 def field @field end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
74 75 76 |
# File 'lib/active_remote/serializers/protobuf.rb', line 74 def value @value end |
Class Method Details
.from_attribute(field, value) ⇒ Object
Class methods
87 88 89 90 |
# File 'lib/active_remote/serializers/protobuf.rb', line 87 def self.from_attribute(field, value) field = self.new(field, value) field.from_attribute end |
Instance Method Details
#from_attribute ⇒ Object
Instance methods
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/active_remote/serializers/protobuf.rb', line 95 def from_attribute case when field. then when field. then when field.repeated? then repeated_value.map { |value| typecast(value) } else typecasted_value end end |