Class: Social::Env
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #inited? ⇒ Boolean
-
#initialize ⇒ Env
constructor
A new instance of Env.
Constructor Details
#initialize ⇒ Env
Returns a new instance of Env.
30 31 32 |
# File 'lib/social/env.rb', line 30 def initialize @inited = false end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/social/env.rb', line 5 def id @id end |
#prefix ⇒ Object
Returns the value of attribute prefix.
5 6 7 |
# File 'lib/social/env.rb', line 5 def prefix @prefix end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/social/env.rb', line 5 def type @type end |
Class Method Details
.init(social_type) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/social/env.rb', line 11 def init() instance.type = instance.id = Social.id_by_type() instance.prefix = Social.prefix_by_type() instance.instance_variable_set(:"@inited", true) end |
.init_by_params(params) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/social/env.rb', line 18 def init_by_params(params) unless = Social.(params) raise "Can't find social type into SocialEnv or SocialParams with params: #{params.inspect}" else init() end end |
Instance Method Details
#inited? ⇒ Boolean
34 35 36 |
# File 'lib/social/env.rb', line 34 def inited? @inited end |