Class: OneApi::PartOfUrlFieldConversionRule
- Inherits:
-
FieldConversionRule
- Object
- FieldConversionRule
- OneApi::PartOfUrlFieldConversionRule
- Defined in:
- lib/oneapi-ruby/objects.rb
Instance Attribute Summary
Attributes inherited from FieldConversionRule
#json_field_name, #object_field_name
Instance Method Summary collapse
- #from_json(value) ⇒ Object
-
#initialize(json_field_name = nil, part_index) ⇒ PartOfUrlFieldConversionRule
constructor
A new instance of PartOfUrlFieldConversionRule.
- #to_json(value) ⇒ Object
Constructor Details
#initialize(json_field_name = nil, part_index) ⇒ PartOfUrlFieldConversionRule
Returns a new instance of PartOfUrlFieldConversionRule.
102 103 104 105 |
# File 'lib/oneapi-ruby/objects.rb', line 102 def initialize(json_field_name=nil,part_index) super(json_field_name) @part_index = part_index; end |
Instance Method Details
#from_json(value) ⇒ Object
107 108 109 110 111 112 113 114 115 |
# File 'lib/oneapi-ruby/objects.rb', line 107 def from_json(value) if ! value return nil end parts = value.split('/') parts[@part_index] end |
#to_json(value) ⇒ Object
117 118 119 |
# File 'lib/oneapi-ruby/objects.rb', line 117 def to_json(value) value end |