Class: CollectionJson::Serializer::Items
- Inherits:
-
Object
- Object
- CollectionJson::Serializer::Items
- Defined in:
- lib/collection_json_serializer/items.rb
Instance Attribute Summary collapse
-
#attributes(*args) ⇒ Object
Returns the value of attribute attributes.
-
#href(*args) ⇒ Object
Returns the value of attribute href.
-
#links ⇒ Object
Returns the value of attribute links.
Instance Method Summary collapse
- #attribute(args) ⇒ Object
- #attributes? ⇒ Boolean
- #href? ⇒ Boolean
- #link(args) ⇒ Object
- #links? ⇒ Boolean
Instance Attribute Details
#attributes(*args) ⇒ Object
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/collection_json_serializer/items.rb', line 5 def attributes @attributes end |
#href(*args) ⇒ Object
Returns the value of attribute href.
4 5 6 |
# File 'lib/collection_json_serializer/items.rb', line 4 def href @href end |
#links ⇒ Object
Returns the value of attribute links.
6 7 8 |
# File 'lib/collection_json_serializer/items.rb', line 6 def links @links end |
Instance Method Details
#attribute(args) ⇒ Object
21 22 23 24 |
# File 'lib/collection_json_serializer/items.rb', line 21 def attribute(args) @attributes = Array.new unless @attributes.is_a?(Array) @attributes << args end |
#attributes? ⇒ Boolean
39 40 41 |
# File 'lib/collection_json_serializer/items.rb', line 39 def attributes? @attributes.present? end |
#href? ⇒ Boolean
35 36 37 |
# File 'lib/collection_json_serializer/items.rb', line 35 def href? @href.present? end |
#link(args) ⇒ Object
26 27 28 29 |
# File 'lib/collection_json_serializer/items.rb', line 26 def link(args) @links = Array.new unless @links.is_a?(Array) @links << args end |
#links? ⇒ Boolean
43 44 45 |
# File 'lib/collection_json_serializer/items.rb', line 43 def links? @links.present? end |