Class: DistributedPress::V1::Social::ReferencedObject
- Inherits:
-
Object
- Object
- DistributedPress::V1::Social::ReferencedObject
- Extended by:
- Forwardable
- Defined in:
- lib/distributed_press/v1/social/referenced_object.rb
Overview
TODO:
Merge with Reference
An object with external references
Direct Known Subclasses
Constant Summary collapse
- URI_FIXES =
Mastodon hides self-replies
%r{&?only_other_accounts=true&?}
- REFERENTIABLE_ATTRIBUTES =
%w[ actor owner attributedTo cc inReplyTo object replies likes shares to publicKey audience alsoKnownAs devices featured featuredTags followers following inbox movedTo outbox first items next orderedItems partOf prev ].freeze
Instance Attribute Summary collapse
-
#dereferencer ⇒ Object
readonly
Returns the value of attribute dereferencer.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#referenced ⇒ Object
readonly
Returns the value of attribute referenced.
Class Method Summary collapse
Instance Method Summary collapse
- #_dump(_) ⇒ Object
-
#initialize(object:, dereferencer:, referenced: nil) ⇒ ReferencedObject
constructor
A new instance of ReferencedObject.
- #parsed_response ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(object:, dereferencer:, referenced: nil) ⇒ ReferencedObject
Returns a new instance of ReferencedObject.
53 54 55 56 57 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 53 def initialize(object:, dereferencer:, referenced: nil) @object = object @dereferencer = dereferencer @referenced = referenced || reference_object(object) end |
Instance Attribute Details
#dereferencer ⇒ Object (readonly)
Returns the value of attribute dereferencer.
48 49 50 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 48 def dereferencer @dereferencer end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
47 48 49 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 47 def object @object end |
#referenced ⇒ Object (readonly)
Returns the value of attribute referenced.
49 50 51 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 49 def referenced @referenced end |
Class Method Details
._load(array) ⇒ Object
63 64 65 66 67 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 63 def self._load(array) object, dereferencer = Marshal.load(array) new(object: object, dereferencer: dereferencer) end |
Instance Method Details
#_dump(_) ⇒ Object
59 60 61 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 59 def _dump(_) Marshal.dump([object, dereferencer]) end |
#parsed_response ⇒ Object
73 74 75 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 73 def parsed_response self end |
#success? ⇒ Boolean
69 70 71 |
# File 'lib/distributed_press/v1/social/referenced_object.rb', line 69 def success? true end |