Module: Socialcastr
- Defined in:
- lib/socialcastr.rb,
lib/socialcastr/api.rb,
lib/socialcastr/base.rb,
lib/socialcastr/like.rb,
lib/socialcastr/user.rb,
lib/socialcastr/comment.rb,
lib/socialcastr/message.rb,
lib/socialcastr/version.rb,
lib/socialcastr/exceptions.rb,
lib/socialcastr/sax/active_resource.rb
Defined Under Namespace
Modules: SAX
Classes: API, BadRequest, Base, ClientError, Comment, Configuration, ConnectionError, Error, ForbiddenAccess, InvalidAttribute, InvalidMethod, Like, Message, MethodNotAllowed, MissingConfiguration, Redirection, ResourceConflict, ResourceGone, ResourceInvalid, ResourceNotFound, SSLError, ServerError, TimeoutError, UnauthorizedAccess, User
Constant Summary
collapse
- VERSION =
"0.2.19"
Class Method Summary
collapse
Class Method Details
.api ⇒ Object
59
60
61
62
63
|
# File 'lib/socialcastr.rb', line 59
def api
config = Configuration.instance
raise MissingConfiguration unless config.ready?
@api ||= API.new(config.username, config.password, config.domain, config.format, config.debug)
end
|
.const_missing(class_name) ⇒ Object
83
84
85
|
# File 'lib/socialcastr.rb', line 83
def const_missing(class_name)
define_element_class(class_name)
end
|
.define_element_class(class_name) ⇒ Object
87
88
89
|
# File 'lib/socialcastr.rb', line 87
def define_element_class(class_name)
Socialcastr.const_set(class_name, Class.new(Socialcastr::Base))
end
|
.get_element_class(class_name) ⇒ Object
74
75
76
77
78
79
80
81
|
# File 'lib/socialcastr.rb', line 74
def get_element_class(class_name)
define_element_class(class_name) unless Socialcastr.const_defined?(class_name)
if RUBY_VERSION < '1.9'
Socialcastr.const_get(class_name)
else
Socialcastr.const_get(class_name, false)
end
end
|
.reset ⇒ Object
65
66
67
68
|
# File 'lib/socialcastr.rb', line 65
def reset
@api = nil
configuration.reset
end
|
.to_class_name(method) ⇒ Object
70
71
72
|
# File 'lib/socialcastr.rb', line 70
def to_class_name(method)
method.to_s.gsub(/^[a-z]|-[a-z]/i) { |a| a.sub("-", '').upcase }
end
|