Class: Atom::Entry
Instance Attribute Summary
Attributes inherited from Element
#elem
Instance Method Summary
collapse
Methods inherited from CoreElement
#add_alternate_link, #alternate_link, #alternate_link=, #alternate_links, element_link_accessor, element_link_accessors, #initialize
Methods inherited from RootElement
#initialize
Methods inherited from Element
#add, element_attr_accessor, element_attr_accessors, element_datetime_accessor, element_datetime_accessors, element_name, element_ns, element_object_list_accessor, element_text_accessor, element_text_accessors, element_text_list_accessor, #get, #get_attr, #get_object, #get_objects, #getlist, #initialize, new, ns, #set, #set_attr, #to_s
Instance Method Details
#add_control(control) ⇒ Object
1011
1012
1013
|
# File 'lib/atomutil.rb', line 1011
def add_control(control)
add(Namespace::APP_WITH_PREFIX, 'control', control)
end
|
#content ⇒ Object
1040
1041
1042
|
# File 'lib/atomutil.rb', line 1040
def content
get_object(@ns, 'content', Content)
end
|
#content=(value) ⇒ Object
1044
1045
1046
1047
1048
1049
|
# File 'lib/atomutil.rb', line 1044
def content=(value)
unless value.is_a?(Content)
value = Content.new(:body => value)
end
set(@ns, 'content', value)
end
|
#control=(control) ⇒ Object
1007
1008
1009
|
# File 'lib/atomutil.rb', line 1007
def control=(control)
set(Namespace::APP_WITH_PREFIX, 'control', control)
end
|
#controls=(control) ⇒ Object
1019
1020
1021
|
# File 'lib/atomutil.rb', line 1019
def controls=(control)
control = control
end
|
#edited=(value) ⇒ Object
1027
1028
1029
|
# File 'lib/atomutil.rb', line 1027
def edited=(value)
set(Namespace::APP_WITH_PREFIX, 'edited', value)
end
|
#in_reply_to(value = nil) ⇒ Object
1051
1052
1053
1054
1055
1056
1057
1058
|
# File 'lib/atomutil.rb', line 1051
def in_reply_to(value=nil)
if value.nil?
get_object(Namespace::THR, 'in-reply-to', ReplyTarget)
else
value = ReplyTarget.new(value) if value.is_a?(Hash)
set(Namespace::THR, 'in-reply-to', value)
end
end
|
#link ⇒ Object
998
999
1000
1001
|
# File 'lib/atomutil.rb', line 998
def link
l = super
l.rel == 'replies' ? l.to_replies_link : l
end
|
#links ⇒ Object
991
992
993
994
995
996
|
# File 'lib/atomutil.rb', line 991
def links
ls = super
ls.collect do |l|
l.rel == 'replies' ? l.to_replies_link : l
end
end
|
#total ⇒ Object
1031
1032
1033
1034
|
# File 'lib/atomutil.rb', line 1031
def total
value = get(Namespace::THR, 'total')
value.nil?? nil : value.to_i
end
|
#total=(value) ⇒ Object
1036
1037
1038
|
# File 'lib/atomutil.rb', line 1036
def total=(value)
set(Namespace::THR, 'total', value.to_s)
end
|